react-async-usefetch

1.0.6 • Public • Published

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

Package Sidebar

Install

npm i react-async-usefetch

Weekly Downloads

4

Version

1.0.6

License

MIT

Unpacked Size

3.82 kB

Total Files

4

Last publish

Collaborators

  • vipin08