Skip to content

CommandHandler

CommandHandler(command): DualClassDecorator

Defined in: packages/cqrs/src/decorators.ts:41

Registers a class as the handler of one command class; the class implements ICommandHandler.

AnyClass

DualClassDecorator

TypeError when command is not a class.

@CommandHandler(CreateUserCommand)
class CreateUserHandler implements ICommandHandler<CreateUserCommand> {
async execute(command: CreateUserCommand) {}
}