• Version 1.1.3
  • Published
  • 5.63 kB
  • 1 dependency
  • MIT license


npm i @types/ee-first
yarn add @types/ee-first
pnpm add @types/ee-first


TypeScript definitions for ee-first




Type Aliases


function first

first: <TEmitter extends EventEmitter>(
eventSpec: Array<[TEmitter, ...string[]]>,
listener: first.Listener<TEmitter>
) => first.Thunk<TEmitter>;
  • Get the first event in a set of event emitters and event pairs, then clean up after itself. Invoke listener on the first event from the list specified in eventSpec.

    Parameter eventSpec

    Array of arrays, with each array in the format [ee, ...event].

    Parameter listener

    Will be called only once, the first time any of the given events are emitted. If error is one of the listened events, then if that fires first, the listener will be given the err argument. listener's arguments: - err: the first argument emitted from an error event, if applicable - ee: the event emitter that fired - event: the string event name that fired - args: an array of the arguments that were emitted on the event


interface Thunk

interface Thunk<TEmitter extends EventEmitter> {}

    method cancel

    cancel: () => void;
    • The group of listeners can be cancelled before being invoked and have all the event listeners removed from the underlying event emitters.

    call signature

    (listener: Listener<TEmitter>): void;

      Type Aliases

      type Listener

      type Listener<TEmitter extends EventEmitter> = (
      err: any,
      ee: TEmitter,
      event: string[],
      args: any[]
      ) => void;

        Package Files (1)

        Dependencies (1)

        Dev Dependencies (0)

        No dev dependencies.

        Peer Dependencies (0)

        No peer dependencies.


        To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

        You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/ee-first.

        • Markdown
        • HTML
          <a href="https://www.jsdocs.io/package/@types/ee-first"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>