We started rebuilding our dashboard components using React from AngularJS over 3 years ago and, in order to have predictable client-side state management we introduced Redux.js inside our stack because of the popularity it gained inside the JavaScript community; that said, the number of lines of codes needed to implement even the simplest form was unnecessarily high, from a simple form to a more complex component like our team management page.

By switching our state management to MobX we removed approximately 40% of our boilerplate code and simplified our front-end development flow, which in the ends allowed us to focus more into product features rather than architectural choices.

READ LESS
12 upvotes·3 comments·205.1K views
Mike Endale
Mike Endale
·
December 6th 2018 at 4:47PM

This is interesting, Gianluca. Have you compared MobX vs. Unstated? If so what was your thoughts? We're planning to move away from Redux.js, but we are having a hard time deciding between Context and other state management solutions. Curious to hear your thoughts

·
Reply
Gianluca Bargelli
Gianluca Bargelli
·
December 7th 2018 at 4:27PM

Hey Mike, I never used Unstated but it looks indeed very promising!

From my understanding it seems to be a very thin layer on top of Context, which is nice since it doesn't introduces new concepts around like MobX does (e.g. computed properties, observables, etc.); that said you can achieve the same mix of local state components with setState and a more global state management by using either MobX or Unstated.

At the end of the day your choice should lean towards what you think is best for your team and for your personal developer productivity: in my experience, while MobX has higher learning curve than other state management solutions, it allows developers coming from a VueJS or AngularJS background to be quickly proficient in it because of the really similar observable concepts present in those two frameworks; on the other hand, a younger solution like Unstated seems more React-centric which doesn't require to learn new concepts in order to be used efficiently.

I hope will help you in the decision, let me know if you have any other questions about this!

·
Reply
Vladyslav Babak
Vladyslav Babak
·
November 27th 2019 at 4:16PM

Hi. Just interesting, why you didn't upgrade Angular version from AngularJS to Angular >= 2? It has nice component-based model, much better than were "$scopes" in AngularJS.

·
Reply
Avatar of Gianluca Bargelli