Function makePromise

  • Easier than new Promise().

    Type Parameters

    • T = void

    Returns {
        promise: Promise<T>;
        reject: ((reason?: any) => void);
        resolve: ((value: T | PromiseLike<T>) => void);
    }

    An object including a promise and the methods to resolve or reject that promise.

    • promise: Promise<T>
    • reject: ((reason?: any) => void)
        • (reason?): void
        • Parameters

          • Optionalreason: any

          Returns void

    • resolve: ((value: T | PromiseLike<T>) => void)
        • (value): void
        • Parameters

          • value: T | PromiseLike<T>

          Returns void