Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace Event<T>

Represents a typed event.

Type parameters

  • T

Callable

  • Represents a typed event.

    Parameters

    • listener: (e: T) => any

      The listener function will be call when the event happens.

        • (e: T): any
        • Parameters

          • e: T

          Returns any

    • Optional thisArgs: any

      The 'this' which will be used when calling the event listener.

    • Optional disposables: Disposable[]

      An array to which a {{IDisposable}} will be added.

    Returns Disposable

    a disposable to remove the listener again.

Index

Properties

Variables

Functions

Object literals

Properties

maxListeners

maxListeners: number

An emitter will print a warning if more listeners are added for this event. The event.maxListeners allows the limit to be modified for this specific event. The value can be set to 0 to indicate an unlimited number of listener.

Variables

Const None

None: Event<any> = Object.assign(function (): { dispose(): void } { return _disposable; }, {get maxListeners(): number { return 0; },set maxListeners(maxListeners: number) { }})

Functions

map

  • map<I, O>(event: Event<I>, mapFunc: (i: I) => O): Event<O>
  • Given an event and a map function, returns another event which maps each element through the mapping function.

    Type parameters

    • I

    • O

    Parameters

    • event: Event<I>
    • mapFunc: (i: I) => O
        • (i: I): O
        • Parameters

          • i: I

          Returns O

    Returns Event<O>

Object literals

Const _disposable

_disposable: object

dispose

  • dispose(): void