I have two actions in two different modules:
unload: ({ commit, state }) => {
console.log(this);
commit('UNLOAD_LOCATIONS_GROUPED');
Object.keys(state.providerList).forEach((npi) => {
store.unregisterModule(`locationsGroup/providersList/${npi.toString()}`);
});
},
unload({ getters, commit }) {
console.log(this);
getters.list.forEach((provider) => {
this.unregisterModule(['providers', 'list', provider.npi]);
});
commit('UNLOAD_PROVIDERS');
},
When I see the value of this in the console, I see that one is the store(what I want) and the other is an object that seems to represent the module when logged looks like this {a: {...}}
Diving into the later object looks like all the same properties of that actions module.
What is the context of this
in an action or how is it derived? As it doesn't seem to be consistent.