DeferredPromise.ts 262 B

123456789101112131415
  1. export class DeferredPromise<T = any> {
  2. promise: Promise<T>;
  3. reject;
  4. resolve;
  5. // eslint-disable-next-line require-jsdoc
  6. constructor() {
  7. this.promise = new Promise<T>((resolve, reject) => {
  8. this.reject = reject;
  9. this.resolve = resolve;
  10. });
  11. }
  12. }