- useAsyncValue<Data>(run, params?): [null | Data, IResult<void, void>, ((data: Data) => void), {
waitForResult: (() => Promise<Data>);
}] Type Parameters
- Data extends unknown = any
Parameters
- run: (() => Data | Promise<Data>)
Optional
params: IParams = {}
Returns [null | Data, IResult<void, void>, ((data: Data) => void), {
waitForResult: (() => Promise<Data>);
}]
- An array containing the current async value, action object for executing the async action, and a setter function
to update the async value.
This function allows you to manage an asynchronous value by providing a run function and optional parameters.