Socket
Socket
Sign inDemoInstall

@ahooksjs/use-request

Package Overview
Dependencies
6
Maintainers
5
Versions
33
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @ahooksjs/use-request

React Hooks for fetching, caching and updating asynchronous data


Version published
Weekly downloads
35K
increased by5.99%
Maintainers
5
Install size
159 kB
Created
Weekly downloads
 

Readme

Source

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');

Documentation

https://ahooks.js.org/hooks/async

FAQs

Last updated on 07 Dec 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc