1.0.1 • Published 2 months ago

@cooperbuckingham/one-pass-global-state v1.0.1

Weekly downloads
8
License
MIT
Repository
-
Last release
2 months ago

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.