It allows us to easily define a default in the param, without adding it inside an object. And, returns only the value and set function (we are not interested in the update function). Btw, looks like you have made a change to the return value. The version we use returns [value, update, set] but in your example here it's changed to [value, set, update]. It's good move.
This is a great library to solve a lot of headaches in React applications.
Glad to know that you are using state-pool in production. The change was made in v0.4.0, I think [state, setState, updateState] makes more sense than [state, updateState, setState], it was also influenced by [state, setState] from useState since we don't want state-pool's API to be very different from react state hook's API.
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 application (quite a large one) and it's working great. Thank you for the work!However, we have written an extended version of
useGlobalState
like this.It allows us to easily define a default in the param, without adding it inside an object. And, returns only the value and set function (we are not interested in the update function). Btw, looks like you have made a change to the return value. The version we use returns [
value
,update
,set
] but in your example here it's changed to [value
,set
,update
]. It's good move.This is a great library to solve a lot of headaches in React applications.
Glad to know that you are using
state-pool
in production. The change was made inv0.4.0
, I think[state, setState, updateState]
makes more sense than[state, updateState, setState]
, it was also influenced by[state, setState]
fromuseState
since we don't wantstate-pool
's API to be very different from react state hook's API.