MobX
The next popular solution for managing the global state is the MobX library. This library differs significantly from Redux, with a concept that is in some ways even the opposite.
MobX is a state management library that provides reactive and flexible interaction with data. Its main idea is to make the application state as simple and transparent as possible, working through small objects and classes that can be created as many times as desired and nested within each other.
Technically, the library allows for creating not just one global state but many small objects directly linked to some functionality of the application, which gives a significant advantage when working with large applications. To get the difference between one global state and MobX states, you can look at the following diagram:
Figure 12.5: MobX state
In MobX, the state of the application is managed using observable
method, which automatically track changes and inform related computed values...