Skip to content

@epikodelabs/actionstack


@epikodelabs/actionstack / MiddlewareAPI

Type Alias: MiddlewareAPI<TState, TDependencies>

MiddlewareAPI<TState, TDependencies> = object

Defined in: types.ts:189

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:190

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:191

Dispatches an action (synchronous or asynchronous).


dependencies()

dependencies: () => TDependencies

Defined in: types.ts:192

Retrieves the current dependencies in the pipeline.

Returns

TDependencies


strategy()

strategy: () => ProcessingStrategy

Defined in: types.ts:193

Retrieves the current processing strategy.

Returns

ProcessingStrategy


queue

queue: ActionQueue

Defined in: types.ts:194

A queue to serialize store operations and middleware dispatches.

Released under the MIT License.