Uneventful
    Preparing search index...
    • Obtain a native promise for a Future or Task

      While tasks and futures have the same interface as native promises, there are occasionally reasons to just use one directly. (For example, Uneventful actually uses this function to implement futures' promise methods!)

      Type Parameters

      • T

      Parameters

      • future: Future<T>

        The future or task to get a native promise for.

      Returns Promise<T>

      A native Promise that resolves or rejects according to whether the future fulfills or rejects. If the future is canceled, the promise is rejected with a CancelError.