Skip to content

@epikodelabs/actionstack


@epikodelabs/actionstack / MiddlewareAPI

Type Alias: MiddlewareAPI<TState, TDependencies>

MiddlewareAPI<TState, TDependencies> = object

Defined in: types.ts:198

Defines the methods and properties available to middleware for interacting with the store. Provides access to state, dispatching actions, dependencies, processing strategy, synchronization, and execution stack.

Type Parameters

TState

TState = any

TDependencies

TDependencies = any

Properties

getState()

getState: (slice?) => any

Defined in: types.ts:199

Retrieves the state or a specific slice of the state.

Parameters

slice?

string | string[] | "*"

Returns

any


dispatch

dispatch: Dispatch<TState, TDependencies>

Defined in: types.ts:200

Dispatches an action (synchronous or asynchronous).


dependencies()

dependencies: () => TDependencies

Defined in: types.ts:201

Retrieves the current dependencies in the pipeline.

Returns

TDependencies


strategy()

strategy: () => ProcessingStrategy

Defined in: types.ts:202

Retrieves the current processing strategy.

Returns

ProcessingStrategy


queue

queue: ActionQueue

Defined in: types.ts:203

A queue to serialize store operations and middleware dispatches.


registry

registry: ActionRegistry

Defined in: types.ts:204

Released under the GNU AGPL v3.