Last change
on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
824 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | import { Observable } from '../Observable';
|
---|
| 2 | import { Subscription } from '../Subscription';
|
---|
| 3 | import { observable as Symbol_observable } from '../symbol/observable';
|
---|
| 4 | export function scheduleObservable(input, scheduler) {
|
---|
| 5 | return new Observable(subscriber => {
|
---|
| 6 | const sub = new Subscription();
|
---|
| 7 | sub.add(scheduler.schedule(() => {
|
---|
| 8 | const observable = input[Symbol_observable]();
|
---|
| 9 | sub.add(observable.subscribe({
|
---|
| 10 | next(value) { sub.add(scheduler.schedule(() => subscriber.next(value))); },
|
---|
| 11 | error(err) { sub.add(scheduler.schedule(() => subscriber.error(err))); },
|
---|
| 12 | complete() { sub.add(scheduler.schedule(() => subscriber.complete())); },
|
---|
| 13 | }));
|
---|
| 14 | }));
|
---|
| 15 | return sub;
|
---|
| 16 | });
|
---|
| 17 | }
|
---|
| 18 | //# sourceMappingURL=scheduleObservable.js.map |
---|
Note:
See
TracBrowser
for help on using the repository browser.