@amiright/hooks
v0.0.1
Published
[![npm version](https://img.shields.io/npm/v/%40amiright%2Fhooks?style=flat-square)](https://www.npmjs.org/package/%40amiright%2Fhooks) [![install size](https://packagephobia.now.sh/badge?p=%40amiright%2Fhooks)](https://packagephobia.now.sh/result?p=%40am
Downloads
55
Readme
@amiright/hooks
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)
...
}