Options
All
  • Public
  • Public/Protected
  • All
Menu

An extended event emitter:

  • Has an invoke method that iterates of the callback return value
  • Has a catcher that can handle callback exceptions

Hierarchy

  • EventEmitter

Implements

Index

Constructors

constructor

Properties

Static __computed

__computed: ICatcher = eventEmitterCatcher

Accessors

catcher

  • get catcher(): ICatcher | undefined
  • set catcher(value: ICatcher | undefined): void

maxListeners

  • get maxListeners(): number | undefined
  • set maxListeners(value: number | undefined): void

Static defaultCatcher

  • get defaultCatcher(): ICatcher
  • set defaultCatcher(value: ICatcher): void

Static defaultMaxListeners

  • get defaultMaxListeners(): number
  • set defaultMaxListeners(value: number): void

Methods

__@iterator

  • __@iterator(): IterableIterator<[Event, IterableIterator<IListener>]>

callbacks

  • callbacks(event: Event): IterableIterator<ICallback>

dispose

  • dispose(): this

emit

  • emit<A>(event: Event, ...args: A): boolean
  • Type parameters

    • A: Array<unknown>

    Parameters

    • event: Event
    • Rest ...args: A

    Returns boolean

entries

  • entries(): IterableIterator<[Event, IterableIterator<IListener>]>

eventNames

  • eventNames(): Array<Event>

getCatcher

  • getCatcher(): ICatcher

getMaxListeners

  • getMaxListeners(): number

invoke

  • invoke<A>(event: Event, ...args: A): IterableIterator<any>
  • Type parameters

    • A: Array<unknown>

    Parameters

    • event: Event
    • Rest ...args: A

    Returns IterableIterator<any>

keys

  • keys(): IterableIterator<Event>

listenerCount

  • listenerCount(event: Event): number

listeners

  • listeners(event: Event): Array<IListener>

names

  • names(): IterableIterator<Event>

off

  • off(event: "newListener" | "removeListener", listener: function): this
  • off(event: Event, listener: IListener): this
  • Parameters

    • event: "newListener" | "removeListener"
    • listener: function
        • (event: Event, listener: IListener): void
        • Parameters

          • event: Event
          • listener: IListener

          Returns void

    Returns this

  • Parameters

    • event: Event
    • listener: IListener

    Returns this

on

  • on(event: "newListener" | "removeListener", listener: function): this
  • on(event: Event, listener: IListener | ICallback): this
  • Parameters

    • event: "newListener" | "removeListener"
    • listener: function
        • (event: Event, listener: IListener): void
        • Parameters

          • event: Event
          • listener: IListener

          Returns void

    Returns this

  • Parameters

    • event: Event
    • listener: IListener | ICallback

    Returns this

once

  • once(event: "newListener" | "removeListener", listener: function): this
  • once(event: Event, listener: IListener): this
  • Parameters

    • event: "newListener" | "removeListener"
    • listener: function
        • (event: Event, listener: IListener): void
        • Parameters

          • event: Event
          • listener: IListener

          Returns void

    Returns this

  • Parameters

    • event: Event
    • listener: IListener

    Returns this

removeAllListeners

  • removeAllListeners(event?: Event): this

setCatcher

  • setCatcher(value: ICatcher): this

setMaxListeners

  • setMaxListeners(value: number): this

subscribe

values

  • values(): IterableIterator<IterableIterator<IListener>>