@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)
...
}