You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an computed property that is expensive to process, and is used in many different components. Using a shared getter as described in http://vuex.vuejs.org/en/state.html works, but the getter gets called once for every instance of the component, even though it's returning the same data.
The only way I can think of doing this with the existing functionality is to manually set a watch on the relevant data, then dispatch a mutation when it changes to update a property in the state object... or just put a getter in a parent component and pass the data down as a prop. In my case I ended up going with the latter, but I would think there should be an easier way. Thoughts?
The text was updated successfully, but these errors were encountered:
Wow, this is awesome. Thanks so much! Seems the caching works even in the functions aren't defined as the same function? Or even if they're not identical? Not sure how all that is managed but this is great. Very impressive stuff you've done all round with vue in general.
I have an computed property that is expensive to process, and is used in many different components. Using a shared getter as described in http://vuex.vuejs.org/en/state.html works, but the getter gets called once for every instance of the component, even though it's returning the same data.
The only way I can think of doing this with the existing functionality is to manually set a watch on the relevant data, then dispatch a mutation when it changes to update a property in the state object... or just put a getter in a parent component and pass the data down as a prop. In my case I ended up going with the latter, but I would think there should be an easier way. Thoughts?
The text was updated successfully, but these errors were encountered: