Open
Description
What problem does this feature solve?
I used to be able to apply a reactive getter to a nested method inside an object instance stored in my v3 vuex
state, but this doesn't appear to work anymore in v4.
In my case it was a mapbox
instance which was created and then stored inside the vuex
v3 store's state. I could then share this instance amongst various components and could also watch the instance for changes via reactive getters.
For example:
state: {
mapInstance: null, // <- gets assigned with a mapbox instance
// mapInstance contains a method called "getZoom()"
},
getters: {
zoom: (state) => (state.mapInstance ? state.mapInstance.getZoom() : null),
}
The same approach no longer works in vuex
v4.
What does the proposed API look like?
I'm assuming something has changed in the internals of vuex
v3 vs. v4: is there a way to deliberately expose certain nested properties or methods to reactive getters in vuex
v4? Or else to enable the previous functionality?