My Vue application uses a Vuex store. Sometimes the user can "reset" the session. This entails resetting the vuex store to the default values and so that ANY pending async operations should be dropped because the Vuex store has been reset. The issue is that when the async calls return, they attempt to modify the store but it has since been reset. How can I force ANY pending async operation to be ignored when the user hits "reset".
I thought of recalling the "createStore" Vuex function but this lead to a dead-end because the global store variable is updated.
Edit: I end up passing a StoreID with EVERY mutation. I store this StoreID value in a variable at the beginning of all my async ACTIONS. The mutation verifies when it's called that the store currently is at the same StoreID version. Is there a more clever way to do this?