ICommandHandler
Defined in: packages/cqrs/src/interfaces.ts:28
Handles one command class, registered with @CommandHandler(Command).
Example
Section titled “Example”@CommandHandler(CreateUserCommand)class CreateUserHandler implements ICommandHandler<CreateUserCommand, string> { async execute(command: CreateUserCommand): Promise<string> { return users.create(command.name); }}Type Parameters
Section titled “Type Parameters”TCommand
Section titled “TCommand”TCommand extends ICommand = ICommand
TResult
Section titled “TResult”TResult = unknown
Methods
Section titled “Methods”execute()
Section titled “execute()”execute(
command):Promise<TResult>
Defined in: packages/cqrs/src/interfaces.ts:32
Parameters
Section titled “Parameters”command
Section titled “command”TCommand
Returns
Section titled “Returns”Promise<TResult>