@ihabshea/asynchooks
v0.0.2
Published
A collection of asyncronous React hooks
Downloads
3
Readme
React Async Hooks
This package is intended to offer asynchronous support for React hooks. For the current beta release, it only supports useState and useEffect, with support coming for other hooks in next releases.
Install
yarn add @ihabshea/[email protected]
or
npm install @ihabshea/[email protected]
Usage
import {useEffectAsync, useStateAsync} from "@ihabshea/asynchooks"
const [complicatedData, setComplicatedData] = useStateAsync([]);
useEffectAsync(async()=>{
//do something really cool/complicated
//but don't forget to specify a dependency list like this:
,[]);