5 ms·
If you thought goto was bad, observers are basically a comefrom statement. You change something and literally anything can happen. Once code starts getting la
by cameldrv 6y ago
If you thought goto was bad, observers are basically a comefrom statement. You change something and literally anything can happen. Once code starts getting large, these will start causing chain reactions and the code gets hard to reason about.
- brundolf 6y agoThe goal is for nearly all of your observers to be nothing but a cache-clear on a pure function ("computed", in MobX's case). Chained reactions (reactions that trigger other reactions) are very rarely necessary and should be kept to a small enough number that you can model the entire state-graph in your head.
- spion 6y agoMobX works well when paired with a Rx-like library for the more complex cases. With that its never necessary to chain reactions.