GraphReFlyTS

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

ParameterTypeDescription
typestringtype value used by the helper.
handleCqrsCommandHandler<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