Function signalToPromise

  • Convert a signal into a promise for the first emitted value.

    Type Parameters

    • T
    • U

    Parameters

    • signal: ISignal<T, U>

      The signal we are listening to.

    • Optional timeout: number

      Timeout to wait for signal in ms (not timeout if not defined or 0)

    Returns Promise<[T, U]>

    a Promise that resolves with a (sender, args) pair.