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