subscribeToObservable.js 517 B

12345678910111213
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var observable_1 = require("../symbol/observable");
  4. exports.subscribeToObservable = function (obj) { return function (subscriber) {
  5. var obs = obj[observable_1.observable]();
  6. if (typeof obs.subscribe !== 'function') {
  7. throw new TypeError('Provided object does not correctly implement Symbol.observable');
  8. }
  9. else {
  10. return obs.subscribe(subscriber);
  11. }
  12. }; };
  13. //# sourceMappingURL=subscribeToObservable.js.map