interface ICommandBus
Since 0.1.0

Registers and executes commands.

Methods

register<TCommand extends CqrsCommand, TResult>(
type: string,
handler: ICommandHandler<TCommand, TResult>
): void

Registers a handler for a command type.

execute<TResult = unknown>(command: CqrsCommand): Promise<TResult>

Executes a command.

Usage

import { type ICommandBus } from "cqrs-plugin/src/index.ts";