useAsyncEffect ​
Hook that triggers the effect callback on updates
lifecycle
medium
test coverage
Last changed: 6 days ago
Installation ​
Library
CLI
Manual
typescript
import { useAsyncEffect } from '@siberiacancode/reactuse';
Usage ​
typescript
useAsyncEffect(async () => console.log("effect runs on updates"), deps);
Demo ​
Api ​
Parameters
Name | Type | Default | Note |
---|---|---|---|
effect | EffectCallback | - | The effect callback |
deps? | DependencyList | - | The dependencies list for the effect |
Type declaration ​
typescript
import type { DependencyList } from 'react';
Source ​
Source • DemoContributors ​
D