From the course: React: State Management (2019)

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

MobX: The object-oriented approach to state management

MobX: The object-oriented approach to state management - React.js Tutorial

From the course: React: State Management (2019)

Start my 1-month free trial

MobX: The object-oriented approach to state management

- [Instructor] While the focus of this course is on React and Redux as solutions for state management, we wouldn't be able to complete a survey on state management solutions without looking at MobX. It takes a fundamentally different approach from Redux, and, as always, comes with its own set of trade offs. It's worth clarifying from the get go that MobX is not a full alternative to Redux. It gives you the ability to manage state, but you should still organize your code into some form of stores and controllers. Benefit to using MobX is that you're not bound to the exact organizational structure of using actions and producers, which gives you flexibility to make different architectural choices. MobX has similar terms to Redux. You can see here we still have one central store, and there are still actions which can mutate state. Notice here that I said mutate. Immutability isn't the preferred practice for using MobX. We're used to thinking of application state as a json object. In the…

Contents