Overview
Environment Variables
REACT_GLOBAL_STATE_DEBUG
- Enables debug logging.
Components
- GlobalStateProvider - Provides GlobalState to its children tree.
Hooks
- getGlobalState() - Gets GlobalState instance from the context.
- getSsrContext() - Gets SsrContext object (the server-side rendering context, which is used to pass global-state-related data between rendering iterations).
- useAsyncCollection() - Resolves and stores at the given path of global state elements of an asynchronous data collection.
- useAsyncData() - Resolves asynchronous data, and stores them at the given path of global state.
- useGlobalState() - The primary hook for interacting with the global state, modeled after the standard React's useState().
Objects
- AsyncDataEnvelope - Plain JavaScript objects created in the global state by useAsyncData() and useAsyncCollection() hooks to hold loaded async data and related meta data.
- GlobalState - An object that holds and manages the global state content.
- SsrContext - An object that holds global-state-related data persistent across multiple SSR (server-side rendering) iterations.