@superwf Regarding your feature request in vuex (vuejs/vuex#895), I came accross the same issue, to be able to use context.cache anywhere in my code.
However, the linked discussion (vuejs/vuex#571) ended up with using action enhancers:
We're finally going in the way of action enhancers.
A nice feature for vuex-cache would be to expose the plugin and an action enhancer wrapper.
API
// expose action enhancer
export function cacheAction(action) {
return function cacheEnhancedAction(context, payload) {
cachePlugin(context)
return action(context, payload)
}
}
@superwf Regarding your feature request in vuex (vuejs/vuex#895), I came accross the same issue, to be able to use context.cache anywhere in my code. However, the linked discussion (vuejs/vuex#571) ended up with using action enhancers:
A nice feature for vuex-cache would be to expose the plugin and an action enhancer wrapper.
API
To be used as:
What do you think ?