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

Registers a handler for a command type.

Type Parameters

TCommand extends CqrsCommand

The command type

TResult

The result type

Parameters

type: string

Command type name (must match command.type)

The command handler

Return Type

void

Usage

import { type ICommandBus } from "common/src/index.ts";