https://github.com/ooade/use-fetch-hook
A custom hook to fetch and cache data
https://github.com/ooade/use-fetch-hook
react react-hooks
Last synced: about 1 year ago
JSON representation
A custom hook to fetch and cache data
- Host: GitHub
- URL: https://github.com/ooade/use-fetch-hook
- Owner: ooade
- Created: 2020-04-20T09:39:56.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-11-01T18:50:18.000Z (over 1 year ago)
- Last Synced: 2025-03-29T15:06:12.209Z (over 1 year ago)
- Topics: react, react-hooks
- Language: JavaScript
- Homepage: https://use-fetch.dev.adegbuyi.me
- Size: 817 KB
- Stars: 112
- Watchers: 5
- Forks: 21
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Use Fetch Hook
TLDR; This repo shows how to build a custom hook to fetch and cache data!
Here's [a deployed version](https://use-fetch-hook-example.netlify.app) of this example on Netlify!
I wrote a piece about it on [Smashing Magazine](https://www.smashingmagazine.com/2020/07/custom-react-hook-fetch-cache-data/).
## Contents
- [Installation](#installation)
- [Run locally](#run-locally)
### Installation
Clone repo:
SSH:
```sh
git clone git@github.com:ooade/use-fetch-hook.git
cd use-fetch-hook
```
or
HTTPS:
```sh
git clone https://github.com/ooade/use-fetch-hook.git
cd use-fetch-hook
```
### Run locally
Start a live-reload development server:
```sh
yarn start
```
---
If you have any question, feel free to [reach out to me](https://twitter.com/_ooade)!