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
| Parameter | Type |
|---|---|
ctx | ActionContext |
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
| Parameter | Type |
|---|---|
ctx | ActionContext |
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.