minca
ApiReactFunctions

Function: useAsync()

function useAsync<T>(load, deps): AsyncState<T>;

Defined in: packages/react/src/use-async.ts:12

Runs load, and again whenever deps change. Until the answer for the current deps arrives it is loading; an answer for older ones is dropped.

Type Parameters

Type Parameter
T

Parameters

ParameterType
load() => Promise<T>
depsDependencyList

Returns

AsyncState<T>

On this page