Choosing MobX over Redux
1. Easy to learn and use
We used MobX over its rival Redux for a variety of reasons. Even though on directness and simplicity alone MobX has proven to be the superior alternative, some of the more critical use-cases where Redux proves to be a little more complex than MobX are listed below:
o Handling async actions with redux-thunk
o Simplifying your code with redux-saga
o Defining selectors to handle computed values, etc.
With MobX, all these situations are “magically” taken care of. You don’t need additional libraries to handle such situations, the handling of these is provided out of the box.
2. Less code to write
To implement a feature in Redux, you need to update up to four artefacts. This includes writing code for reducers, actions, containers and components. This is particularly cumbersome if you’re working on a small project. MobX only requires you to update two artefacts (i.e. the store and the view component).
3. Full support for object-oriented programming
4. Dealing with nested data is easy