Skip to content

UsePipeline

UsePipeline(…entries): DualClassDecorator

Defined in: packages/pipeline/src/handler-pipeline.ts:57

Declares the behaviors that run around a handler, outermost first: behavior classes or [Behavior, options] tuples such as cache({ key }). The global behaviors wrap these; a behavior declared in both runs once, at its global position, with these options merged over the global ones. The handler runtime reads the declaration with pipelineOf.

…PipelineBehaviorEntry[]

DualClassDecorator

TypeError on a malformed entry.

@CommandHandler(CreateUserCommand)
@UsePipeline(idempotent({ keyFactory }), audit({ action: 'user.create' }))
class CreateUserHandler implements ICommandHandler<CreateUserCommand> {
async execute(command: CreateUserCommand) {}
}