7 ms·
This is the way Elm works and I believe some people used or advocated for using Redux in this way early on. It never really caught on in React apps in my experi
by jamil7 7y ago
This is the way Elm works and I believe some people used or advocated for using Redux in this way early on. It never really caught on in React apps in my experience but it makes some interesting debugging methods easy to implement.
- miglmj 7y agoThis is also how it works in Clojurescript (through Reagent/Re-frame). I don't have too much JS react experience, but I often read this kind of article and marvel at how huge the mental load is working on react projects in native JS.
- vga805 7y agoYou use a global db atom in re-frame for global state, but there's nothing stopping you from using a reagent atom local to a component, is there? I never thought of the existence of the global db as the thing that ALL state should go in., or is that a community best practice? Edit: after digging through the re-frame docs themselves, you can see here that local reagent atoms are used for local state even with the global app db: https://github.com/day8/re-frame/blob/69a3fcd411369fff65404e7d6a924ce1968e2dba/examples/todomvc/src/todomvc/views.cljs https://github.com/day8/re-frame/blob/69a3fcd411369fff65404e...