jxom / react-loads

React Loads is a backend agnostic library to help with external data fetching & caching in your UI components.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Basic cache /context example doesn't seem to work

andycloke opened this issue · comments

sorry if I'm missing something dumb, but as I understand it if I use the 'basic caching' example the network request shouldnt be made a second time. I used the exact example from here https://github.com/jxom/react-loads#basic-cache

"react-loads": "^8.3.4",
"axios": "^0.19.0",
"typescript": "3.5.3"

and the network request is made each time, i.e. it's not cached:
Screenshot 2019-07-12 at 14 29 00

I missed this. doh!
I needed to wrap the app https://github.com/jxom/react-loads#firstly

and use loadPolicy: 'cache-first'

commented

Maybe I should make this more clearer in the docs! :)