Skip to content

Interface: AsyncAction()<TState, TDependencies>

Defined in: types.ts:33

Represents an asynchronous action (thunk) that can dispatch other actions and access state.

Used for side effects and complex state flows. Receives utilities for dispatching, reading state, and accessing app-level dependencies.

Type Parameters

TState

TState = any

The shape of the application or relevant state.

TDependencies

TDependencies extends Record<string, any> = Record<string, any>

The structure of the dependencies object.

AsyncAction(dispatch, getState, dependencies): Promise<void>

Defined in: types.ts:34

Parameters

dispatch

(action) => Promise<void>

Function to dispatch synchronous or asynchronous actions.

getState

() => TState

Function to retrieve the current state.

dependencies

TDependencies

Application dependencies injected into async logic.

Returns

Promise<void>

A Promise that resolves when the async operation finishes.

Released under the MIT License.