using multiple stores
sirpy opened this issue · comments
The current suggestion to use nested stores doesn't allow same component to use two different stores.
The suggestion to use namespacing removes the separation of concerns possibility and will cause rerender in components needing only one store.
Using two stores seems to be working use react hooks ie useStore, but withStore doesn't seem to support composing. Any solution for that?
Hey there! You have a few options:
- Use
useStore
(preferred) - Use
createConnectedStoreAs
. See https://undux.org/#examples/namespaced-state