Jelajahi Sumber

Add resolveBy.

Herby Vojčík 5 bulan lalu
induk
melakukan
f07a2a3e4d
1 mengubah file dengan 1 tambahan dan 0 penghapusan
  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());
         });
     }
 }