Options
All
  • Public
  • Public/Protected
  • All
Menu

emitter2

Index

Type aliases

Data

Data<T>: Set<Listener<T>>

Type parameters

  • T: unknown[]

Listener

Listener<T>: (...params: T) => void

Type parameters

  • T: unknown[]

Type declaration

    • (...params: T): void
    • Parameters

      • Rest ...params: T

      Returns void

Functions

Const emit

  • emit<T>(emitter: Data<T>, ...params: T): void
  • Type parameters

    • T: unknown[]

    Parameters

    • emitter: Data<T>
    • Rest ...params: T

    Returns void

Const risingEdgeEmitter

  • risingEdgeEmitter(emitter: Data<[boolean]>): Data<[]>

Const toPromise

  • toPromise<T>(emitter: Data<T>): Promise<T>
  • Listens for one emit and resolves the emitted params

    Type parameters

    • T: unknown[]

    Parameters

    Returns Promise<T>

    A promise that resolves the array of parameters. The promise will never reject

Generated using TypeDoc