@aracna/core - v1.5.0
    Preparing search index...

    Class EventEmitter<T>

    The EventEmitter class is used to emit events and register listeners. The API is based on the Node.js EventEmitter API.

    Aracna Reference

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    listeners: EventEmitterListener<T, keyof T>[]
    maxListeners: number

    Methods

    • Counts the listeners that match the name, callback and options. If no arguments are passed, all listeners will be counted.

      Type Parameters

      • K extends string | number | symbol

      Parameters

      Returns number

    • Emits an event.

      Type Parameters

      • K extends string | number | symbol

      Parameters

      • name: K
      • ...args: Parameters<T[K]>

      Returns boolean

    • Returns the maximum number of listeners that can be registered for a single event.

      Returns number

    • Adds a listener, which will be called when the event is emitted.

      Optionally the listener can be removed after the first call with the once option. Optionally the listener can be prepended to the listeners array with the prepend option.

      Type Parameters

      • K extends string | number | symbol

      Parameters

      Returns this

    • Sets the maximum number of listeners that can be registered for a single event.

      Parameters

      • n: number

      Returns this