API Reference
Main functions and return types exported by global-rx-state.
createRxState
If there is one argument, it is anonymous tuple mode; if a name is passed, it is named object mode. Named mode supports calls inside components.
createRxStateTuple
Used when the name is determined at runtime but the order of tuple return is needed. Storage option can be used with named key.
createRxReducer / createRxReducerTuple
storage values
RxStateStorage includes persistence backends and compatible aliases. sessionstorage and sessionStorage use the browser's sessionStorage.
autoselects the available localForage driver in the order of IndexedDB, WebSQL, and localStorage. The resolved storage of the lookup API returns the actual selected backend, not auto.
Storage utilities
You can check the storage of named state and reducer with three utilities each.
hasRxState checks if the specified storage configuration has a value. findRxStateStorages returns the actual backend with confirmed values without duplication, and getRxStateStorageInfo always returns the confirmed storage locations as an array.
storageKey is the actual item key, and fullKey is the complete key that can be checked in the backend exposing the flat key. If the same name exists in multiple storage configurations, multiple items will be returned in the getRxStateStorageInfo results.