This was very instructive, and successful. Thoughts, comments, notes:
With Zustand, you move all your state-related logic into the store. Advantages:
All state logic (actions) is right next to state definitions.
State logic can easily use other parts of state logic, because it too is right there.
Components do not need to track detailed state logic or changes to it, only changes to the actions API (action functions and their signatures). This simplifies components.
State logic is easy to reuse across components: just get it out of the store.
It imposes a certain discipline on the conception and use of state. Bad state management becomes much more obvious, and more obvious how to fix. Meanwhile components just subscribe to the parts of it they naturally need.
Note how computed values, such as isConfigLoaded is used: const isConfigLoaded = useStore(state => state.isConfigLoaded());
Config is folded naturally into the notion of state, and state logic actions can and do use it.
This project did not contain egregious prop drilling, but Zustand still results in a noticeable simplification of all the components that use state (directly or via props).
IMO, components have become slightly to moderately easier to understand, due in part to the segregation of state logic to the store.
This was very instructive, and successful. Thoughts, comments, notes:
isConfigLoaded
is used:const isConfigLoaded = useStore(state => state.isConfigLoaded());