1.0.1 • Published 3 years ago
cc-fetch-lib v1.0.1
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.