subscribeToPromise.js 551 B

1234567891011121314
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var hostReportError_1 = require("./hostReportError");
  4. exports.subscribeToPromise = function (promise) { return function (subscriber) {
  5. promise.then(function (value) {
  6. if (!subscriber.closed) {
  7. subscriber.next(value);
  8. subscriber.complete();
  9. }
  10. }, function (err) { return subscriber.error(err); })
  11. .then(null, hostReportError_1.hostReportError);
  12. return subscriber;
  13. }; };
  14. //# sourceMappingURL=subscribeToPromise.js.map