interface BehaviorLike
Since 0.3.0

The structural shape both behaviour contracts satisfy, and the element type of composeBehaviorChain's behaviors array.

IPipelineBehavior and IIngressBehavior both satisfy this structurally — neither needed to change — which is what lets one composer serve both the CQRS pipeline and the four non-HTTP ingress chains.

Type Parameters

TWork

The work item the behaviour wraps

TResult

The chain result type

Methods

handle(
work: TWork,
next: () => Promise<TResult>
): TResult | Promise<TResult>

Wraps the rest of the chain.

Usage

import { type BehaviorLike } from "common/src/index.ts";