Μετάβαση στο περιεχόμενο

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) {}
}