Skip to content

Function: createActionHandler()

createActionHandler(config): (action, next, lock) => Promise<void>

Defined in: starter.ts:26

Functional handler for managing actions within middleware.

Parameters

config

MiddlewareConfig

Configuration object for the middleware.

Returns

  • A function to handle actions.

(action, next, lock): Promise<void>

Handles the given action, processing it either synchronously or asynchronously.

Parameters

action

The action to be processed.

AsyncAction<any, Record<string, any>> | Action<any>

next

Function

The next middleware function in the chain.

lock

SimpleLock

The lock instance to manage concurrency for this action.

Returns

Promise<void>

  • A promise if the action is asynchronous, otherwise void.

Released under the MIT License.