@wpkernel/pipeline / NodeMiddleware
Interface: NodeMiddleware<TKey, TInvocation, TOutput, TState, TRequest>
Ordered phases around exactly one node invocation.
Middleware has no continuation and cannot admit or suppress other nodes. before phases enter in registration order; after, error and cancel unwind entered middleware in reverse order. Each phase remains synchronous until that phase's return exposes a callable then.
Type Parameters
TKey
TKey extends NodeKey
TInvocation
TInvocation
TOutput
TOutput
TState
TState
TRequest
TRequest
Properties
node
ts
readonly node: TKey;after()?
ts
readonly optional after: (options) => MaybePromise<readonly TRequest[]>;Parameters
options
MiddlewareEnteredOptions<TKey, TInvocation, TState> & object
Returns
MaybePromise<readonly TRequest[]>
before()?
ts
readonly optional before: (options) => MaybePromise<MiddlewareResult<TState, TRequest>>;Parameters
options
MiddlewareInvocationOptions<TKey, TInvocation>
Returns
MaybePromise<MiddlewareResult<TState, TRequest>>
cancel()?
ts
readonly optional cancel: (options) => MaybePromise<void>;Parameters
options
MiddlewareEnteredOptions<TKey, TInvocation, TState> & object
Returns
MaybePromise<void>
error()?
ts
readonly optional error: (options) => MaybePromise<void>;Parameters
options
MiddlewareEnteredOptions<TKey, TInvocation, TState> & object
Returns
MaybePromise<void>
