You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
5 years ago | |
|---|---|---|
| .. | ||
| dist | 5 years ago | |
| es | 5 years ago | |
| lib | 5 years ago | |
| README.md | 5 years ago | |
| package.json | 5 years ago | |
README.md
useRequest
Production-ready React Hook to manage asynchronous data.
Core Characteristics
- Auto-triggered request and Manually-triggered Request
- SWR(stale-while-revalidate)
- Cache / Preload
- Refresh On Window Focus
- Polling
- Debounce
- Throttle
- Concurrent Request
- Dependent Request
- Loading Delay
- Pagination
- Load more, data recovery and scroll position recovery
- ......
Installing
Inside your React project directory, run the following:
yarn add @ahooksjs/use-request
yarn add @ahooksjs/use-request
Or with npm:
npm install @ahooksjs/use-request
Example
import useRequest from '@ahooksjs/use-request';
const { data, error, loading, run } = useRequest('/api/user');