DEV Community

Discussion on: Would you use redux or another state management in 2020?

Collapse
 
m3h0w profile image
Michał Gacka

I've been using mobx lately because I always had a good experience with observables. My goal is to always use technologies that don't impose an unnecessary cognitive strain when writing code.

The reason why I use React is because - unlike other frameworks - it feels very natural to use. Redux doesn't so I try to avoid it.

Collapse
 
wolfiton profile image
wolfiton • Edited

Thanks for sharing @michalgacka, the reasons why you use Mobx.

Are you using it with typescript or es7?(because you mentioned observables that are Rxjs and for me that sends my thoughts, towards Angular 9 Rxjs).

Collapse
 
m3h0w profile image
Michał Gacka • Edited

TypeScript.

It's actually an interesting case as well because I was trying to avoid TypeScript initially similarity to redux. Following the same reasoning, I found that beyond the initial resistance to introduce more complexity, TypeScript reduced the cognitive strain after a few days, while with Redux I never got to a point when I would find it intuitive enough.

I checked the easy-peasy library btw. and I think I'll give it a try on the next project. Looks really good.

Thread Thread
 
wolfiton profile image
wolfiton

I think i will also go with easy peasy or rematch because my stack is scalable by default and Xstate is not.

So I don't want to lose my advantage of scaling by using a nonscalable technology, even though it looks awesome.

Thread Thread
 
m3h0w profile image
Michał Gacka

Depending on what's your relationship with OOP, I really recommend trying mobx with classes you construct yourself side by side with the functional approaches to really boil the problem down to how you'd solve it if we weren't thrown into this opinionated world :)

I wonder also if mobx felt so natural to me because I only use it for data management (loading, errors, computed, etc.) and transformations and handle the rest using context and local state.