Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • T

  • R

Hierarchy

  • Subscriber<T>
    • OptionSubscriber

Implements

  • SubscriptionLike
  • Observer<T>

Index

Constructors

constructor

  • Parameters

    • destination: Subscriber<R>
    • config: R

    Returns OptionSubscriber

Properties

closed

closed: boolean

A flag to indicate whether this Subscription has already been unsubscribed.

type

{boolean}

syncErrorThrowable

syncErrorThrowable: boolean
internal

syncErrorThrown

syncErrorThrown: boolean
internal

syncErrorValue

syncErrorValue: any
internal

Static EMPTY

EMPTY: Subscription
nocollapse

Methods

_next

  • _next(value: T): void
  • Parameters

    • value: T

    Returns void

_unsubscribeAndRecycle

  • _unsubscribeAndRecycle(): Subscriber<T>
  • deprecated

    This is an internal implementation detail, do not use.

    Returns Subscriber<T>

add

  • add(teardown: TeardownLogic): Subscription
  • Adds a tear down to be called during the unsubscribe() of this Subscription.

    If the tear down being added is a subscription that is already unsubscribed, is the same reference add is being called on, or is Subscription.EMPTY, it will not be added.

    If this subscription is already in an closed state, the passed tear down logic will be executed immediately.

    Parameters

    • teardown: TeardownLogic

      The additional logic to execute on teardown.

    Returns Subscription

    Returns the Subscription used or created to be added to the inner subscriptions list. This Subscription can be used with remove() to remove the passed teardown logic from the inner subscriptions list.

complete

  • complete(): void
  • The {@link Observer} callback to receive a valueless notification of type complete from the Observable. Notifies the Observer that the Observable has finished sending push-based notifications.

    Returns void

error

  • error(err?: any): void
  • The {@link Observer} callback to receive notifications of type error from the Observable, with an attached Error. Notifies the Observer that the Observable has experienced an error condition.

    Parameters

    • Optional err: any

    Returns void

next

  • next(value?: T): void
  • The {@link Observer} callback to receive notifications of type next from the Observable, with a value. The Observable may call this method 0 or more times.

    Parameters

    • Optional value: T

    Returns void

remove

  • remove(subscription: Subscription): void
  • Removes a Subscription from the internal list of subscriptions that will unsubscribe during the unsubscribe process of this Subscription.

    Parameters

    • subscription: Subscription

      The subscription to remove.

    Returns void

unsubscribe

  • unsubscribe(): void
  • Returns void

Static create

  • create<T>(next?: function, error?: function, complete?: function): Subscriber<T>
  • A static factory for a Subscriber, given a (potentially partial) definition of an Observer.

    nocollapse

    Type parameters

    • T

    Parameters

    • Optional next: function
        • (x?: T): void
        • Parameters

          • Optional x: T

          Returns void

    • Optional error: function
        • (e?: any): void
        • Parameters

          • Optional e: any

          Returns void

    • Optional complete: function
        • (): void
        • Returns void

    Returns Subscriber<T>

    A Subscriber wrapping the (partially defined) Observer represented by the given arguments.