API

Class Observer<T>

Represent an observer registered to a given Observable object.

Type Parameters

  • T

Implements

Index
  • Creates a new observer

    Type Parameters

    • T

    Parameters

    • callback: (eventData: T, eventState: EventState) => void

      defines the callback to call when the observer is notified

    • mask: number

      defines the mask of the observer (used to filter notifications)

    • scope: any = null

      defines the current scope used to restore the JS context

    Returns Observer<T>

callback: (eventData: T, eventState: EventState) => void

Defines the callback to call when the observer is notified

mask: number

Defines the mask of the observer (used to filter notifications)

scope: any = null

[null] Defines the current scope used to restore the JS context

unregisterOnNextCall: boolean = false

Gets or sets a property defining that the observer as to be unregistered after the next notification

  • Remove the observer from its observable This can be used instead of using the observable's remove function.

    Parameters

    • defer: boolean = false

      if true, the removal will be deferred to avoid callback skipping (default: false)

    Returns void