3 ms·
I've been using MobX (https://github.com/mobxjs/mobx https://github.com/mobxjs/mobx) in my day job for a year now in a very large client-side app, and hands-dow
by Torn 8y ago
I've been using MobX (https://github.com/mobxjs/mobx https://github.com/mobxjs/mobx) in my day job for a year now in a very large client-side app, and hands-down prefer it to redux.
Initially I was wondering why we didn't have a centralised store, but once free from that mindset it allows you to keep observable data locally to where it's needed. Much nicer for encapsulation and separation of concerns.
Far less boilerplate too, as MobX does some very smart usage & dirty checking for you.
mobx-react also provides an @observer class annotation, which ends up working pretty magically - things re-render when they need to.
If anyone's interested, here are some tutorials from the author: https://egghead.io/courses/manage-complex-state-in-react-apps-with-mobx https://egghead.io/courses/manage-complex-state-in-react-app...