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 am wondering if is possible to watch store properties, or subscribe to actions/mutations, inside a VueJS component, when using vuex-module-decorators?
Of course, I can always do this, assuming that someStore is assigned with getModule(<storeClassName>). The code below is an example code from inside a VueJS component using vue-property-decorator:
However, I find this rather cumbersome and kind of a code smell, because it creates an unnecessary property on the VueJS component for the sole purpose of watching changes to it.
The text was updated successfully, but these errors were encountered:
Both should be equivalent... but I'm not 100% sure on whether this requires the store to be registered to the store, but getModule should cause the store to dynamically register itself.
The only way to do this on dynamic registration is to modify getModule itself to do it after calling registerModule perhaps. michaelolof/vuex-class-component#27 has a interesting API proposal that will do just that using statics.
I am wondering if is possible to watch store properties, or subscribe to actions/mutations, inside a VueJS component, when using
vuex-module-decorators
?Of course, I can always do this, assuming that
someStore
is assigned withgetModule(<storeClassName>)
. The code below is an example code from inside a VueJS component usingvue-property-decorator
:However, I find this rather cumbersome and kind of a code smell, because it creates an unnecessary property on the VueJS component for the sole purpose of watching changes to it.
The text was updated successfully, but these errors were encountered: