3 ms·
Great post, I'm gonna take this off topic now because I've been thinking a lot about this and curious your thought: > we go through an even greater indirection
by dustingetz 11y ago
Great post, I'm gonna take this off topic now because I've been thinking a lot about this and curious your thought:
> we go through an even greater indirection, firing an abstract action and letting a store figure out how to make changes to the appropriate data
Can't this indirection just be modeled as a function? Instead of firing an action we call a function, which returns the appropriate state updates. No metaprogramming, and composable when used with cursor pattern to run the actual state update effect. (ActionStoreDispatcher flux doesn't compose)
- asolove 11y agoYeah! (You probably know about this but others may not.) I like Elm's architecture, which has typed update functions that can be nested. This makes the full stack of the component composable and is something like a cursor: https://gist.github.com/evancz/2b2ba366cae1887fe621 https://gist.github.com/evancz/2b2ba366cae1887fe621