cc-fetch-lib
v1.0.1
Published
`import useGet from "cc-fetch-lib/useGet";`
Downloads
1
Readme
import useGet from "cc-fetch-lib/useGet";
//usages
const {data, error, loading, refetch} = useGet(link)
its a simple custom hook that returns 3 states and a function.
when fetch call begins the loading state is true. once data is received, loading is false and data state updates. if error is encountered, the error state becomes true.