Options
Menu

Class Stream

A wrapper on RxJS Subscription.

Stream is a simple construct that adds the ability to re-subscribe to the provided Observable. Given an Observable, it immediately gets subscribed, and the subscription instance is saved as Stream's property. The Stream keeps the reference to the provided Observable, and uses it for re-subscription when asked.

See https://docs.activejs.dev/utilities/stream for more details.

Hierarchy

  • Stream

Constructors

Accessors

Custom Stream Methods

Constructors

constructor

  • new Stream(observable: Observable<any>): Stream
  • Given an Observable, subscribes to it immediately, and saves the Subscription instance.

    Parameters

    • observable: Observable<any>

      The Observable to be used for subscription.

    Returns Stream

Accessors

isSubscribed

  • get isSubscribed(): boolean
  • Indicates whether the Stream is active or not.
    i.e.: Whether the provided Observable is subscribed or not.

    Returns boolean

subscription

  • get subscription(): Subscription

Custom Stream Methods

resubscribe

  • resubscribe(): Subscription
  • Unsubscribes and then immediately subscribes again, also, replaces the subscription instance with the new Subscription instance.

    Returns Subscription

    Subscription instance returned by subscribing to the provided Observable {@link Observable.subscribe}.

unsubscribe

  • unsubscribe(): void
  • Unsubscribes from current subscription instance using {@link Subscription.unsubscribe}.
    It also deletes the Subscription instance.

    Returns void