npm install --save er-custom-hooks
import React, {useEffect} from 'react'
import {useAsync, AsyncWrapper} from 'er-custom-hooks'
import getExampleReasources from 'er-custom-hooks-http'
const Example = () => {
const {executeFunction, status, value} = useAsync(getExampleReasources)
useEffect(() => {
executeFunction()
}, [])
return <AsyncWrapper status={status}>
<div>{value}</div>
</AsyncWrapper>
}
export default Example