Re:Show HN: Redux Offline – Build Offline-First Apps for Web...
by timdorr on Thursday March 30, 2017 @03:29PM
(#13998198)
Maintainer of Redux here.
I concur with giving Mobx a try. I'm using it at least one product so far and it's been working out great.
One thing I will say is that because your subscriptions are set up implicitly, it's easy to have things misbehave in unexpected ways. For instance, if you update multiple observable properties in a single function, it will fire off observers multiple times. That could put you into an unexpected state and cause some errors.
Luckily, almost every time I've run into this kind of issue, I've discovered there's an API to cover that case (runInAction in the previous example's case). And they APIs themselves are really neat and fun to work with. `when` and `observable.array`'s extensions are some of my favorites.
Re:Show HN: Redux Offline – Build Offline-First Apps for Web...
by Kiro on Thursday March 30, 2017 @05:00PM
(#13998823)
Do you pass the MobX stores down to every child component as props or do you use @inject? I started with the former but all of a sudden all my components had all these "default" props that cluttered things up. @inject seems great but the documentation doesn't push it enough to make me believe it's best practice.
Re:Show HN: Redux Offline – Build Offline-First Apps for Web...
by rawrmaan on Thursday March 30, 2017 @07:00PM
(#13999677)
Neither. Just import a singleton root store and reference it directly.
Mobx v/s Redux does kick off the OOP v/s Functional debate, but as a developer my productivity and effectiveness is measured in terms of my ability to ship software not in terms of my programming style, and it's my personal belief that Mobx does make me more productive as compared to Redux.
For developers new to the whole Flux/Redux/Mobx/State Management world, I highly suggest to give Mobx a try.