Represents a non-viewport subscription to a table, and all data currently known to be present in the subscribed columns. This class handles incoming snapshots and deltas, and fires events to consumers to notify of data changes.

Unlike TableViewportSubscription, the "original" table does not have a reference to this instance, only the "private" table instance does, since the original cannot modify the subscription, and the private instance must forward data to it.

Represents a subscription to the table on the server. Changes made to the table will not be reflected here - the subscription must be closed and a new one optioned to see those changes. The event model is slightly different from viewports to make it less expensive to compute for large tables.

Hierarchy

  • TableSubscription

Implements

Constructors

Properties

EVENT_UPDATED: string

Indicates that some new data is available on the client, either an initial snapshot or a delta update. The detail field of the event will contain a TableSubscriptionEventData detailing what has changed, or allowing access to the entire range of items currently in the subscribed columns.

Accessors

  • get columns(): Column[]
  • The columns that were subscribed to when this subscription was created

    Returns Column[]

    Column

Methods

  • Listen for events on this object.

    Type Parameters

    • T

      the type of the data that the event will provide

    Parameters

    • name: string

      the name of the event to listen for

    • callback: ((e) => void)

      a function to call when the event occurs

        • (e): void
        • Parameters

          • e: CustomEvent<T>

          Returns void

    Returns (() => void)

    Returns a cleanup function.

      • (): void
      • Returns void

  • Stops the subscription on the server.

    Returns void

  • Type Parameters

    • T

    Parameters

    • eventName: string
    • Optional timeoutInMillis: number

    Returns Promise<CustomEvent<T>>

  • Removes an event listener added to this table.

    Type Parameters

    • T

    Parameters

    • name: string
    • callback: ((e) => void)
        • (e): void
        • Parameters

          • e: CustomEvent<T>

          Returns void

    Returns boolean