3 ms·
Yeah, you basically can't do that without wrecking performance, which is why I think attempts at more "functional purity" (which, LOL, React has now entirely ab
by moshmosh 5y ago
Yeah, you basically can't do that without wrecking performance, which is why I think attempts at more "functional purity" (which, LOL, React has now entirely abandoned anyway, see: hooks) and "single-source-of-truth" than what's currently the norm in the React world (or anywhere else in FE web dev) are misguided.
- zdragnar 5y agoI still prefer a global store and keeping functions as pure as possible. I just make a distinction between application state and ephemeral (i.e. local state such as drag / drop tracking, forms, etc). There are a number of advantages to centralizing your event handling pipeline and using middleware functions to perform many of the more important side effect producing behaviors (i.e. analytics events, etc.). YMMV though, and I now that I am working on an app that makes extensive use of hooks and useContext, I cant say that the world has ended (even if it is quite a bit more confusing).