Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Event<T>

Provides the ability raise and subscribe to an event.

Type parameters

  • T

Hierarchy

  • Event

Index

Properties

Private _event

_event: Event = new CesiumEvent()

Accessors

numberOfListeners

  • get numberOfListeners(): number
  • Get the number of listeners currently subscribed to the event.

    Returns number

    Number of listeners currently subscribed to the event.

Methods

addEventListener

  • Add an event listener.

    Parameters

    • listener: function
        • (data: T): void
        • Parameters

          • data: T

          Returns void

    Returns RemoveCallback

    A convenience function which removes this event listener when called

raiseEvent

  • raiseEvent(data: T): void
  • Raises the event by calling each registered listener with all supplied arguments.

    Parameters

    • data: T

    Returns void

removeEventListener

  • removeEventListener(listener: function): boolean
  • Remove an event listener.

    Parameters

    • listener: function
        • (data: T): void
        • Parameters

          • data: T

          Returns void

    Returns boolean

    True if the listener was removed; false if the listener and scope are not registered with the event.

Generated using TypeDoc