Function fromPromise

  • Convert a Promise to an event source

    Each time the resulting source is subscribed to, it will emit an event for the result of the promise, then close the connection. (Unless the promise is rejected, in which case the connection throws and closes each time the source is subscribed.) Non-native promises and non-promise values are converted using Promise.resolve().

    Type Parameters

    • T

    Parameters

    • promise: T | Promise<T> | PromiseLike<T>

    Returns Source<T>