Represents an event subscription, and a safe way to cancel it.

cancel

Properties

Accessors

Methods

Properties

name?: string

Subscription's name option, if it was set with method SubEvent.subscribe.

Accessors

  • get live(): boolean
  • Indicates whether the subscription is live / active.

    It can be useful to subscribers when SubEvent.cancelAll is used without their knowledge.

    Returns boolean

Methods

  • Cancels the live subscription. The subscriber won't receive any more events.

    It also sets flag live to false.

    Returns boolean

    • true - subscription has been successfully cancelled
    • false - nothing happened, as subscription wasn't live