I have two Vuex store modules: ListItems
and ListSort
. ListItems
has a getter that is essentially computed from the state of both of these modules. See the below code:
// Import the ListSort store module
import listSort from './list-sort';
// ListItems getters
const getters = {
companiesSorted: () => {
return _.orderBy(state.companies,
[listSort.state.sortAttribute],
[listSort.state.sortDirection]);
},
};
However, when the state in ListSort
is changed (i.e. sortAttribute
or sortDirection
are changed), this is not causing the ListItems getter to recompute. How can I tell Vuex that, given a dependency to computing companiesStored
has changed, Vuex should recompute that getter?
Thanks!