Efficient and simple to use global state management for React, implemented with hooks, and spiced by useful data management functions (async retreival, caching, etc.)
OTHER License
Published by birdofpreyru over 2 years ago
Beware: Further library changes / updates for React 18 might be needed, and likely to follow in next releases, as the library is tested in real projects.
Published by birdofpreyru over 2 years ago
"main"
entry into package.json
to serve as a fallback for environments that do not recognize "exports"
object. "main"
points to the CommonJS build for Node LTS.Published by birdofpreyru over 2 years ago
"exports"
object in package.json
to export CommonJS build for Node LTS, and ES module for browsers.Published by birdofpreyru over 2 years ago
Published by birdofpreyru about 3 years ago
Published by birdofpreyru about 3 years ago
Published by birdofpreyru over 3 years ago
Published by birdofpreyru over 3 years ago
useAsyncData()
hook to be compatible with SSR timeout feature; and updates SSR setup documentation to show how SSR timeout should be implemented.Published by birdofpreyru over 3 years ago
useGlobalState()
hook did not behave correctly when its path
argument was changed while the host component was mounted.useAsyncData()
hook had a similar problem, due to internal dependency on useGlobalState()
.useAsyncCollection()
hook did not work correctly when its id
or path
arguments were changed while the host component was mounted.Published by birdofpreyru over 3 years ago
Published by birdofpreyru over 3 years ago
Published by birdofpreyru over 3 years ago
REACT_GLOBAL_STATE_DEBUG
environment variable enjection by Webpack.Published by birdofpreyru over 3 years ago
Published by birdofpreyru over 3 years ago
useAsyncData(..)
hook (and, hence, in useAsyncCollection(..)
hook as well). Now the data age is checked on every component re-render, and if stale the refresh is triggered.hardDeps
option of useAsyncData(..)
and useAsyncCollection(..)
is deprecated and removed, as now deps
option will play its exact role (forcing a refresh of non-stale data due to a change in dependencies, in useEffect(..)
hook's sense).useAsyncData(..)
and useAsyncCollection(..)
now pass the previously loaded data, stored in the global state currently, into the loader
calls when data (re-)load is initiated.Published by birdofpreyru almost 4 years ago
hardDeps
option to useAsyncData()
hook. This option allows to force-reload data when any dependency provided via this option (array) changes.maxage
, refreshAge
, garbageCollectionAge
options of useAsyncData()
hook are not treated as undefined anymore (do not result in the default 5 mins settings used).Published by birdofpreyru almost 4 years ago
Published by birdofpreyru about 4 years ago
>= 16.14.0
, or 15.7.0
, 0.14.10
(which also suppor the new JSX transform).process
variable (e.g. client-side code bundled by Webpack@5+, without explcit process
polyfilling.Published by birdofpreyru about 4 years ago
Published by birdofpreyru about 4 years ago
useAsyncData(..)
and useAsyncCollection(..)
hooks.