3 ms·
If you want a lightweight cache, check out react-query[0]. It's a nice abstraction around fetching data, and it handles caching out of the box, as well as refet
by dceddia 6y ago
If you want a lightweight cache, check out react-query[0]. It's a nice abstraction around fetching data, and it handles caching out of the box, as well as refetching data when the browser regains focus and a lot of other nice things.
0: https://github.com/tannerlinsley/react-query https://github.com/tannerlinsley/react-query
- davedx 6y agoThanks, I'll check it out. I find using apollo's graphql client library solves this reasonably well too, though the syntax is a bit clunky and knowing when you need to explicitly define a cache function or not is tricky.