4 ms·
> What's shared in there is the idea that unidirectional data flow is a whole lot easier to reason about It makes some things a whole lot "easier to reason abo
by marknutter 11y ago
> What's shared in there is the idea that unidirectional data flow is a whole lot easier to reason about
It makes some things a whole lot "easier to reason about" (so sick of that phrase), but other things not so "easy to reason about", like, for instance, error handling. Getting my head wrapped around the fact that asynchronous errors had to live in their own stores and be handled in the same way as all other data passed to the view was certainly not "easy" to reason about and still doesn't sit right with me to this day. You make concessions with every pattern and there is no silver bullet.
- jowiar 11y agoI'm not saying easy to reason about in the sense of "easy to learn because it isn't a change from how we used to do things", but rather, in that it allows one to easily answer: - What is the current state of things? - How did we arrive at the current state of things? - What should the UI look like given the current state of things? It means that we can say: "Thing A happened, then Thing B happened, then Thing C happened". And then conceptualize "what should things look like after that chain of events". I've found this to make errors a whole lot easier about, because I don't need to piece together the state when an error happens -- just fire an action that says "An Error happened", then the stores figure out how to act accordingly. It's just another action.