Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/phryneas/use-cached-fetch
A helper library that builds upon react-async's useAsync method to provide a useful asynchronous fetch hook with a shared cache between your components.
https://github.com/phryneas/use-cached-fetch
cache fetch hook library react
Last synced: 10 days ago
JSON representation
A helper library that builds upon react-async's useAsync method to provide a useful asynchronous fetch hook with a shared cache between your components.
- Host: GitHub
- URL: https://github.com/phryneas/use-cached-fetch
- Owner: phryneas
- License: mit
- Created: 2019-08-04T18:42:03.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-11T00:29:18.000Z (over 3 years ago)
- Last Synced: 2024-10-20T12:52:07.408Z (18 days ago)
- Topics: cache, fetch, hook, library, react
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/use-cached-fetch
- Size: 933 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# use-cached-fetch
This is a helper library that builds upon react-async's `useAsync` method to provide a useful asynchronous fetch hook with a shared cache between your components.
Simply wrap a part of your app in a `` and then use the provided `useCachedFetch` hook.
The result is the same result as you would be getting from `useAsync`, so you can use react-async's `Loading`, `Fulfilled`, `Rejected` and `Settled` components with it.
For convenience, these components are re-exported by this library.Please note that this library is used for data fetching, not for data submitting (as those calls usually should not be cached). For deferred method calls, please use react-async's `useFetch` directly.