Interface of a Defer Object.

interface DeferObj<T> {
    promise: Promise<T>;
    reject: ((error) => void);
    resolve: ((result) => void);
}

Type Parameters

  • T

Properties

promise: Promise<T>

Underlying promise. This is what you probably what to pass around.

reject: ((error) => void)

The reject function. This is exactly the reject function that is passed to the promise constructor callback.

Type declaration

    • (error): void
    • The reject function. This is exactly the reject function that is passed to the promise constructor callback.

      Parameters

      • error: Error

      Returns void

resolve: ((result) => void)

The resolve function. This is exactly the resolve function that is passed to the promise constructor callback.

Type declaration

    • (result): void
    • The resolve function. This is exactly the resolve function that is passed to the promise constructor callback.

      Parameters

      • result: T

      Returns void

Generated using TypeDoc