Use MobX actions to change and guard state

Share this video with your friends

Send Tweet

This lesson explains how actions can be used to control and modify the state of your application. They help you to structure your code base and integrate well with the MobX React Devtools. Actions automatically create transactions, which group changes together.

Anton Telesh
Anton Telesh
~ 8 years ago

Well, it's all cool. But can you share any articles on how the change detection works underneath? Because now it looks like a magic. And I don't like magic in programming.

Michel Weststrate
Michel Weststrate(instructor)
~ 8 years ago

That question is simple answered, there is no change detection :) Only change notification. For a global idea what MobX reacts to check: https://mobxjs.github.io/mobx/best/react.html. The derivation algorithm is explained here: https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254 and also in my recent ruhrjs talk (not yet published), but slides can be found here: http://magixmobx.surge.sh

mathias gheno
mathias gheno
~ 6 years ago

The useStrict is not working anymore. There is another configuration for that:

https://github.com/mobxjs/mobx/issues/1446