A SPA website can have different store modules with specific getters for each screen, which can be associated with ajax requests.
Executing all the getters automatically will not only execute all the associated requests, but also can create inconsistencies or very different behaviour.
Maybe getters could be collapsed and disabled by default, and call them all only on expand. Allowing to use the rest of tools normally.
Are you implying that you are making ajax calls in getters? :scream_cat:
Are you implying that you are making ajax calls in getters?
A handler function requests ajax once
So I have this issue with one of my app where evaluating getters on vuex:init is throwing errors and breaks everything. I am using vuex-router-sync and one the getters is written as such :
export const stationId = (state, getters, rootState, rootGetters) => {
return rootState.route.params.stationId
}
This getter is not meant to be evaluated on init and since vuex-router-sync add the route state module asynchronously it fails.
This is an easy fix :
export const stationId = (state, getters, rootState, rootGetters) => {
return rootState.route && rootState.route.params.stationId
}
But it feels bad to modify the codebase just for using the devtool.
Most helpful comment
So I have this issue with one of my app where evaluating getters on vuex:init is throwing errors and breaks everything. I am using vuex-router-sync and one the getters is written as such :
This getter is not meant to be evaluated on init and since vuex-router-sync add the
routestate module asynchronously it fails.This is an easy fix :
But it feels bad to modify the codebase just for using the devtool.