Class BaseSubscriptionSetAbstract

Class representing the common functionality for the SubscriptionSet and MutableSubscriptionSet classes.

SubscriptionSets can only be modified inside a SubscriptionSet.update callback.

The SubscriptionSet is an iterable; thus, the contained Subscriptions can be accessed in for-of loops or spread into an Array for access to the ECMAScript Array API, e.g. [...realm.subscriptions][0].

Hierarchy (view full)

Constructors

Accessors

  • get error(): null | string
  • If state is SubscriptionSetState.Error, this will be a string representing why the SubscriptionSet is in an error state. It will be null if there is no error.

    Returns null | string

    A string representing the error, or null if there is no error.

  • get isEmpty(): boolean
  • Whether there are no subscriptions in the set.

    Returns boolean

    true if there are no subscriptions in the set, false otherwise.

  • get length(): number
  • Returns number

    The number of subscriptions in the set.

  • get version(): number
  • The version of the SubscriptionSet. This is incremented every time a SubscriptionSet.update is applied.

    Returns number

    The version of the SubscriptionSet.

Methods

  • Makes the subscription set iterable.

    Returns IterableIterator<Subscription>

    Iterable of each value in the set.

    Example

    for (const subscription of subscriptions) {
    // ...
    }
  • Find a subscription by name.

    Parameters

    • name: string

      The name to search for.

    Returns null | Subscription

    The named subscription, or null if the subscription is not found.

  • Find a subscription by query. Will match both named and unnamed subscriptions.

    Type Parameters

    • Subscription

    Parameters

    Returns null | Subscription

    The subscription with the specified query, or null if the subscription is not found.

Generated using TypeDoc