Options
All
  • Public
  • Public/Protected
  • All
Menu

Class View<State, Events, UpdateHandlers>

View.

Type Parameters

  • State extends object = any

    the type of the stored state

  • Events extends object = any

    the type of all update events, based on the gRPC method input types

  • UpdateHandlers extends Handlers<State, Events> = Handlers<State, Events>

Hierarchy

  • View

Implements

Index

Properties

serviceName: string

The gRPC service name for this component.

service: Service

The protobuf Service for this component.

options: Required<View.Options>

Options for this component.

clients: undefined = undefined

Access to gRPC clients (with promisified unary methods).

updateHandlers?: UpdateHandlers

View update handlers.

remarks

The names of the properties must match the names of all the view methods specified in the gRPC descriptor.

Constructors

  • new View<State, Events, UpdateHandlers>(desc: string | string[], serviceName: string, options?: View.Options): View<State, Events, UpdateHandlers>
  • Create a new view.

    Type Parameters

    • State extends object = any

    • Events extends object = any

    • UpdateHandlers extends Handlers<State, Events> = Handlers<State, Events>

    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 interface

    • Optional options: View.Options

      The options for this view

    Returns View<State, Events, UpdateHandlers>

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

  • setUpdateHandlers(handlers: UpdateHandlers): View<State, Events, UpdateHandlers>
  • Set the update handlers of the view.

    remarks

    Only used for updates where event transformation is enabled through "transform_updates: true" in the grpc descriptor.

    Parameters

    • handlers: UpdateHandlers

      The handler callbacks

    Returns View<State, Events, UpdateHandlers>

    This view

Generated using TypeDoc