useAsync
Sourceimport { useAsync } from "@prestojs/util";
Params:
Parameter | Type | Description | |
---|---|---|---|
* | fn | ||
options An object with the properties below | |||
options.args | any[] | ||
options.onError | |||
options.onSuccess | |||
options.trigger | "MANUAL"|"DEEP"|"SHALLOW" |
Returns:
An object with these properties: | |||
---|---|---|---|
Property | Type | Description | |
* | error | ErrorT|null | |
* | isLoading | boolean | |
* | reset | ||
* | response | ResultT|null | Deprecated: |
* | result | ResultT|null | |
* | run |