I've created a vuex store with namespaces that retrieves a specific store entry based on the current route parameter.
import Router from '../../router/index'
const options = {
routeIdentifier: 'stepId'
}
export function fetchFromRoute(state) {
if (!options.routeIdentifier || !Router.currentRoute.params) {
return null
}
return state.all.find(item => {
return item.identifier === Router.currentRoute.params[options.routeIdentifier]
})
}
While this function works correctly on initial load, it doesn't automatically update when the route changes.
Is there a way to force the getter to recalculate upon route change?