We use your state-pool in our production system and it works great. We don't have to worry about hard-to-maintain Context API. Thank you very much for the innovative work. Also, I wonder why React doesn't support this approach by default.
Also, I've created a minified version (200 bytes gziped) of state-pool for Preact (github.com/SupunKavinda/preact-glo...), with one hook, useGlobalState.
Btw, I saw that you are using immer as an dependency. Is it for the reducer?
Immer is used for object comparisons to make sure that even a small change in object property triggers re-render to all components subscribed to a related global state.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
We use your
state-pool
in our production system and it works great. We don't have to worry about hard-to-maintain Context API. Thank you very much for the innovative work. Also, I wonder why React doesn't support this approach by default.Also, I've created a minified version (200 bytes gziped) of state-pool for Preact (github.com/SupunKavinda/preact-glo...), with one hook,
useGlobalState
.Btw, I saw that you are using immer as an dependency. Is it for the
reducer
?Immer is used for object comparisons to make sure that even a small change in object property triggers re-render to all components subscribed to a related global state.