1.0.6 • Published 3 years ago
react-async-usefetch v1.0.6
react-async-usefetch
Purpose
Simple useFetch Hook.
Installation
npm i react-async-usefetch
or
yarn add react-async-usefetch
Usage
import usefetch from 'react-async-usefetch';
const { dataResponse, dataError, isDataLoading} = useFetch({ url, options, delay, returnDict: ["dataResponse", "dataError", "isDataLoading"]});
console.log("dataResponse: ", dataResponse);
console.log("dataError: ", dataError);
console.log("isDataLoading: ", isDataLoading);
Default function and return dict.
response: ["response", "error", "isLoading"]
fetch function: window.fetch