3 ms·
I have to deal with Redux at work and I absolutely hate how much code I have to write to flip a binary in my React component! I used MobX on the side projects
by msoad 9y ago
I have to deal with Redux at work and I absolutely hate how much code I have to write to flip a binary in my React component!
I used MobX on the side projects and I absolutely love it! I might be biased but I think MobX is so much better for any size project. Redux is just too good at marketing and their "Hello world" looks very very interesting and reasonable but it doesn't scale. When you have multiple people working on the same codebase it becomes a hot mess!
If you're starting a project, give MobX a shot and see how it goes.
- nathan_f77 9y agoOh man, everyone's talking about MobX in here, and I've never really looked at it. This looks pretty awesome. I don't particularly enjoy using Redux either, so I think I might try this out on my next project. I'm looking for some replacement libraries from the Redux ecosystem. I've already found https://github.com/pinqy520/mobx-persist https://github.com/pinqy520/mobx-persist, which looks pretty good. What do you use instead of redux-saga or redux-observable? E.g. for async stuff like ajax calls, or listening for events and emitting new events? Concrete example: You want to listen to a variety of events in your app, and send analytics. Some of your analytics events require looking up parts of the state and doing some processing. This is really easy to do in redux-saga, but how would you do this with MobX? Or would you use something else for this? EDIT: Ah, I think I was looking for "autorun": https://mobx.js.org/refguide/autorun.html https://mobx.js.org/refguide/autorun.html