API Reference
cqrsCommandHandler()
Convenience helper for declaring typed command handlers in a CQRS bundle.
Import
import { cqrsCommandHandler } from "@graphrefly/ts/cqrs";
Signature
function cqrsCommandHandler(
type: string,
handle: CqrsCommandHandler<TCommand, TEvent>,
): CqrsCommandHandlerDefinition<TCommand, TEvent>
Parameters
| Parameter | Type | Description |
|---|---|---|
type | string | type value used by the helper. |
handle | CqrsCommandHandler<TCommand, TEvent> | handle value used by the helper. |
Returns
A CqrsCommandHandlerDefinition<TCommand, TEvent> value.
Example
import { cqrsCommandHandler } from "@graphrefly/ts/cqrs";
Source
packages/ts/src/cqrs/index.ts