source: trip-planner-front/node_modules/rxjs/_esm2015/internal/testing/ColdObservable.js@ 84d0fbb

Last change on this file since 84d0fbb was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.3 KB
Line 
1import { Observable } from '../Observable';
2import { Subscription } from '../Subscription';
3import { SubscriptionLoggable } from './SubscriptionLoggable';
4import { applyMixins } from '../util/applyMixins';
5export class ColdObservable extends Observable {
6 constructor(messages, scheduler) {
7 super(function (subscriber) {
8 const observable = this;
9 const index = observable.logSubscribedFrame();
10 const subscription = new Subscription();
11 subscription.add(new Subscription(() => {
12 observable.logUnsubscribedFrame(index);
13 }));
14 observable.scheduleMessages(subscriber);
15 return subscription;
16 });
17 this.messages = messages;
18 this.subscriptions = [];
19 this.scheduler = scheduler;
20 }
21 scheduleMessages(subscriber) {
22 const messagesLength = this.messages.length;
23 for (let i = 0; i < messagesLength; i++) {
24 const message = this.messages[i];
25 subscriber.add(this.scheduler.schedule(({ message, subscriber }) => { message.notification.observe(subscriber); }, message.frame, { message, subscriber }));
26 }
27 }
28}
29applyMixins(ColdObservable, [SubscriptionLoggable]);
30//# sourceMappingURL=ColdObservable.js.map
Note: See TracBrowser for help on using the repository browser.