Skip to main content

Interface: ActionMiddleware

An action middleware.

Properties​

filter?​

optional filter?: (ctx) => boolean;

A filter function to decide if an action middleware function should be run or not.

Parameters​

ParameterType
ctxActionContext

Returns​

boolean


middleware​

middleware: (ctx, next) => any;

An action middleware function. Rember to return next() if you want to continue the action or throw if you want to cancel it.

Parameters​

ParameterType
ctxActionContext
next() => any

Returns​

any


subtreeRoot​

readonly subtreeRoot: object;

Subtree root object (object and child objects) this middleware will run for. This target "filter" will be run before the custom filter.