Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ValueEntity<State, CommandHandlers>

Value Entity.

Type Parameters

Hierarchy

  • ValueEntity

Implements

Index

Properties

serviceName: string

The gRPC service name for this component.

service: Service

The protobuf Service for this component.

options: Required<ValueEntity.Options>

Options for this component.

Access to gRPC clients (with promisified unary methods).

initial?: ValueEntity.InitialCallback<State>

The initial state callback.

commandHandlers: CommandHandlers

The command handlers.

Constructors

  • new ValueEntity<State, CommandHandlers>(desc: string | string[], serviceName: string, entityType: string, options?: ValueEntity.Options): ValueEntity<State, CommandHandlers>
  • Create a new value entity.

    remarks

    Never change the entityType after deploying a service that stored data of this type.

    Type Parameters

    Parameters

    • desc: string | string[]

      A descriptor or list of descriptors to parse, containing the service to serve

    • serviceName: string

      The fully qualified name of the service that provides this entities interface

    • entityType: string

      The entity type name for all value entities of this type

    • Optional options: ValueEntity.Options

      The options for this entity

    Returns ValueEntity<State, CommandHandlers>

Methods

  • lookupType(messageType: string): Type
  • Lookup a protobuf message type.

    This is provided as a convenience to lookup protobuf message types.

    Parameters

    • messageType: string

    Returns Type

    The protobuf message type

  • setCommandHandlers(commandHandlers: CommandHandlers): ValueEntity<State, CommandHandlers>
  • Set the command handlers of the entity.

    Parameters

    • commandHandlers: CommandHandlers

      The command handler callbacks

    Returns ValueEntity<State, CommandHandlers>

    This entity

Generated using TypeDoc