Summary
We have just gone over the main ideas and the implementation of MobX and MobX-State-Tree in the Funbook app. MobX may not be as popular as Redux in the React ecosystem, but it does hold a very important place, nonetheless. MobX presents a different way of looking at the state than Redux does and a very different way of managing it. We created data models and attached actions to them. If you are a developer trying to understand an existing app for the first time, having the data and actions in one place may be very helpful to understand what is going on more quickly. MobX takes this state centralization one step further by introducing views. We have all the tools necessary for creating and managing a state accessibly from the very same place where we declare the shape of the state. The last step is to add observer
wrappers to the components that need to be aware of state changes and then we have a very nice MobX-managed app.
It’s great to know how you can manage states...