@amiright/hooks

0.0.1 • Public • Published

@amiright/hooks

npm version install size npm downloads

Install with npm

npm install --save @amiright/hooks

useRequest

A React hook used to send request

Usage

import { useRequest } from '@amiright/hooks'

am4core.useTheme(am4themes_animated)

const App = () => {
  /**
   * 
   * @param {Object} config Axios config
   */
  const { loading, status, data, error } = useRequest({ 
    method: 'get',
    url: 'YOU_API_ENDPOINT'
  })
  console.log(loading, status, data, error)
 
  ...
}

Package Sidebar

Install

npm i @amiright/hooks

Weekly Downloads

0

Version

0.0.1

License

ISC

Unpacked Size

5.21 kB

Total Files

6

Last publish

Collaborators

  • boaol