Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type Aliases

EventSourcedEntityCommandContext<Event>: EventSourcedEntity.CommandContext<Event>

Context for an event sourced command.

Type Parameters

CommandHandler<State, Events>: ((command: any, state: State, context: EventSourcedEntity.CommandContext<Events>) => Promise<CommandReply> | CommandReply)

Type Parameters

Type declaration

    • An event sourced entity command handler.

      Parameters

      • command: any

        The command message, this will be of the type of the gRPC service call input type

      • state: State

        The entity state

      • context: EventSourcedEntity.CommandContext<Events>

        The command context

      Returns Promise<CommandReply> | CommandReply

      The message to reply with, it must match the gRPC service call output type for this command, or if a Reply is returned, contain an object that matches the output type

CommandHandlers<State, Events>: {}

Event sourced entity command handlers.

remarks

The names of the properties must match the names of the service calls specified in the gRPC descriptor for this event sourced entity's service.

Type Parameters

Type declaration

EventHandler<State, Events>: Events extends any ? ((event: Events, state: State) => State) : never

An event sourced entity event handler.

param event

The event

param state

The entity state

returns

The new entity state

Type Parameters

EventHandlers<State, Events>: {}

Event sourced entity event handlers.

remarks

The names of the properties must match the short names of the events.

Type Parameters

Type declaration

Behavior<State, Events, CommandHandlers, EventHandlers>: { commandHandlers: CommandHandlers; eventHandlers: EventHandlers }

An event sourced entity behavior.

Type Parameters

Type declaration

  • commandHandlers: CommandHandlers

    The command handlers.

    The names of the properties must match the names of the service calls specified in the gRPC descriptor for this event sourced entity's service.

  • eventHandlers: EventHandlers

    The event handlers.

    The names of the properties must match the short names of the events.

BehaviorCallback<State, Events, CommandHandlers, EventHandlers>: ((state: State) => Behavior<State, Events, CommandHandlers, EventHandlers>)

Type Parameters

Type declaration

    • (state: State): Behavior<State, Events, CommandHandlers, EventHandlers>
    • An event sourced entity behavior callback.

      This callback takes the current entity state, and returns a set of handlers to handle commands and events for it.

      Parameters

      • state: State

        The entity state

      Returns Behavior<State, Events, CommandHandlers, EventHandlers>

      The new entity state

InitialCallback<State>: ((entityId: string) => State)

Type Parameters

Type declaration

    • (entityId: string): State
    • Initial state callback.

      This is invoked if the entity is started with no snapshot.

      Parameters

      • entityId: string

        The entity id

      Returns State

      The entity state

Generated using TypeDoc