# Function: useAsync()

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

Defined in: [packages/react/src/use-async.ts:12](https://github.com/leifriksheim/minca/blob/main/react/src/use-async.ts#L12)

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 |
| ------ |
| <a id="type-parameter-t"></a> `T` |

## Parameters

| Parameter | Type |
| ------ | ------ |
| `load` | () => `Promise`\<`T`\> |
| `deps` | `DependencyList` |

## Returns

[`AsyncState`](https://minca.dev/api/react/type-aliases/AsyncState.md)\<`T`\>
