-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow access to setter mutations #11
Comments
So you want to do something like: @Module({ generateMutationSetters: true })
class MyModule extends VuexModule {
foo = "bar";
}
const myModule = new MyModule({ store, name: "myModule" });
myModule.foo = "baz"; ? It would not be hard to implement, but I'm not sure whether it is against the design principles of vuex (flux) or not. Do you think it would be beneficial to allow? |
Yes this is what I mean. I‘m not completely sure this follows the flux principles, but there are two reasons which let me lean towards yes:
|
Alright, I'll implement this. Although I think I'll keep it as an undocumented feature, as I'm still not sure whether this should be encouraged or not. |
When using the
generateMutationSetters
option, for each state property a mutation is generated, that sets the property.Those setter mutations are only available inside of actions, not when using the module instance directly.
Do you think we should allow access from the outside? Or would you say that it is a much better practice to only do changes in the actions?
The text was updated successfully, but these errors were encountered: