0.0.2 • Published 3 years ago

@ihabshea/asynchooks v0.0.2

Weekly downloads
5
License
GPL-3.0-or-later
Repository
github
Last release
3 years ago

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/asynchooks@0.0.1

or

npm install @ihabshea/asynchooks@0.0.1

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:
,[]);