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

Package detail

@hooks-plus/use-async-effect

robertpanvip19ISC1.0.1TypeScript support: included

use-async-effect

useEffects, useAsyncEffect, usePromiseEffect

readme

可以接受async编程方式的副作用函数

📦 Installation

npm install @hooks-plus/use-async-effect

🔨 Usage

Note: 可以像React.useEffect一样使用也可以在useAsyncEffect使用async函数 不过promise中需要返回一个作用域给cleanup回收副作用

see demo