Skip to content

Instantly share code, notes, and snippets.

@leadwolfx
leadwolfx / deferred-promise.ts
Created December 8, 2021 18:58 — forked from GFoley83/deferred-promise.ts
Deferred Promise for Typescript
/**
* A new instance of deferred is constructed by calling `new DeferredPromse<T>()`.
* The purpose of the deferred object is to expose the associated Promise
* instance APIs that can be used for signaling the successful
* or unsuccessful completion, as well as the state of the task.
* @export
* @class DeferredPromise
* @implements {Promise<T>}
* @template T
* @example