@cooperbuckingham/one-pass-global-state
v1.0.1
Published
Personal use typescript global react hook based state
Downloads
28
Readme
Simple Global State
Restrictive, typed, access to global state via hook and single key, for react
How to use
- Call
CbSimpleGlobalState.init(<initial global state>)
to get the singleton instance of CbSimpleGlobalState; - use the useGlobalState hooks on the singleton to access global state
- use the useLocalState hooks to handle local state
Note on Restrictions
- To keep things simple and strongly typed, to focus on developer ease of use, there are only 7 tiers of nested typed global state.