scheduleObservable.js 1010 B

12345678910111213141516171819
  1. /** PURE_IMPORTS_START _Observable,_Subscription,_symbol_observable PURE_IMPORTS_END */
  2. import { Observable } from '../Observable';
  3. import { Subscription } from '../Subscription';
  4. import { observable as Symbol_observable } from '../symbol/observable';
  5. export function scheduleObservable(input, scheduler) {
  6. return new Observable(function (subscriber) {
  7. var sub = new Subscription();
  8. sub.add(scheduler.schedule(function () {
  9. var observable = input[Symbol_observable]();
  10. sub.add(observable.subscribe({
  11. next: function (value) { sub.add(scheduler.schedule(function () { return subscriber.next(value); })); },
  12. error: function (err) { sub.add(scheduler.schedule(function () { return subscriber.error(err); })); },
  13. complete: function () { sub.add(scheduler.schedule(function () { return subscriber.complete(); })); },
  14. }));
  15. }));
  16. return sub;
  17. });
  18. }
  19. //# sourceMappingURL=scheduleObservable.js.map