Options
All
  • Public
  • Public/Protected
  • All
Menu

Options that can be passed into method subscribe.

Hierarchy

  • ISubOptions

Index

Properties

Properties

Optional name

name: string

Unique subscription name. It helps with diagnosing subscription leaks, via method getStat, and provides additional details during error handling. The name should help identify place in the code where the subscription was created.

see

getStat

Optional onCancel

onCancel: () => void

Subscription-cancel callback, to be notified on subscription explicit cancel call, or when cancelled implicitly via cancelAll.

This is mostly for internal usage, and has no protection against errors, should the handler throw any.

Type declaration

    • (): void
    • Returns void

Optional thisArg

thisArg: any

Calling / this context for the subscription callback function.

Standard way of passing in context is this way:

event.subscribe(func.bind(this))

With this option you can also do it this way:

event.subscribe(func, {thisArg: this})

Legend

  • Property
  • Method
  • Property
  • Inherited method

Generated using TypeDoc