Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

react-async-usefetch

vipin0820MIT1.0.6

Simple useFetch hook

usefetch, react, react-hook, http, hook, react hook, react usefetch

readme

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