TLDR; This repo shows how to build a custom hook to fetch and cache data!
Here's a deployed version of this example on Netlify!
I wrote a piece about it on Smashing Magazine.
Clone repo:
SSH:
git clone git@github.com:ooade/use-fetch-hook.git
cd use-fetch-hookor
HTTPS:
git clone https://github.com/ooade/use-fetch-hook.git
cd use-fetch-hookStart a live-reload development server:
yarn startIf you have any question, feel free to reach out to me!