Within my vuex store, I have this getter that retrieves authority_count:
authority_count (state, getters) {
return getters.dataView?.getUint16(4, true) || state.pack.authority_count;
}
I want authority_count to default to state.pack.authority_count when dataView is null. However, once a file is loaded on the page, I want authority_count to be recalculated after the loading process is complete and dataView is populated with the file's data. How can I achieve this functionality?
The issue arises when I ensure getters.dataView returns a DataView object, as authority_count still defaults to state.pack.authority_count.
I am using a file input to extract binary data from files and load it into an arrayBuffer accessed by the dataView getter.
Link to loading arrayBuffer code
Logs related to authority_count:
[HMR] Waiting for update signal from WDS...
getters.dataView: null
state.pack.authority_count: 5