node.js 552 B

123456789101112131415161718192021222324
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6. /*
  7. * Deferred pattern built on top of Promise.
  8. */
  9. var Deferred = function Deferred() {
  10. var _this = this;
  11. _classCallCheck(this, Deferred);
  12. this.promise = new Promise(function (resolve, reject) {
  13. _this.resolve = resolve;
  14. _this.reject = reject;
  15. });
  16. };
  17. exports.default = Deferred;