Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EventStream

Hierarchy

  • EventStream

Index

Properties

Static Private theListeners

theListeners: object

Type declaration

  • [key: string]: Array<function>

Methods

Static addListener

  • addListener(eventType: string, listener: function): object
  • Register a specific callback to be called on a particular event. A token is returned that can be used to remove the listener.

    Parameters

    • eventType: string
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns object

Static emit

  • emit(eventType: string, ...args: any[]): void
  • Emits an event of the given type with the given data. All callbacks that are listening to the particular event type will be notified.

    Parameters

    • eventType: string
    • Rest ...args: any[]

    Returns void

Static listeners

  • listeners(eventType: string): function[]
  • Return an array of listeners that are currently registered for the given event type.

    Parameters

    • eventType: string

    Returns function[]

Static removeAllListeners

  • removeAllListeners(eventType: string): void
  • Removes all of the registered listeners. eventType is optional, if provided only listeners for that event type are removed.

    Parameters

    • eventType: string

    Returns void

Generated using TypeDoc