Browse Source

Add resolveBy.

Herby Vojčík 5 months ago
parent
commit
f07a2a3e4d
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/deferred.js

+ 1 - 0
src/deferred.js

@@ -7,6 +7,7 @@ export default class Deferred {
         this.promise = new Promise((resolve, reject) => {
             this.resolve = resolve;
             this.reject = reject;
+            this.resolveBy = fn => resolve(fn());
         });
     }
 }