useAsyncEffect
The useAsyncEffect hook allows usage of an async function as the effect call back function. More Info...
import { useAsyncEffect } from '@archibald/client';
useAsyncEffect(PARAMETERS);
Parameters
| Name | Type | Optional | Description | Default |
|---|---|---|---|---|
| action | AsyncFunction | AsyncOptions | A function that should be executed as effect callback or an object holding callback functions to be used in the hook. | ||
| deps | any | any[] | ✔️ | Hook dependencies. | An empty array. |
action
An action can be a function or an object. More Info...
Passing a function as the action
AsyncFunction
Passing an object as the action
AsyncOptions
The AsyncOptions object has the following properties:
| Property | Type | Description |
|---|---|---|
| effect | AsyncFunction | An async function that should be executed as effect callback. |
| destroy | DestroyCallback | A function that should be executed in the cleanup callback. |