Replies: 1 comment 2 replies
-
You can drop the Note that Actions can be enforced at runtime through https://mobx.js.org/configuration.html#enforceactions, but you have probably already seen that |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I am new to Mobx coming from a different State management lib. What I like about Mobx is the pattern to only set an observable with an action. What I dislike hower that I am still able to set my observable directly in code without my code editor complaining about this.
I wonder if there is already a solution in place to prevent this from happening.
I came up with a solution myself creating a class that has a private observable and public computed and action to access the private observable but I am not sure if this has performance implications.
This class can than be used to define properties in viewModels. The firstName then has a "value" getter to bind to and a "set" method to update the value.
Beta Was this translation helpful? Give feedback.
All reactions