source: trip-planner-front/node_modules/rxjs/_esm2015/internal/testing/HotObservable.js@ 6a80231

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

initial commit

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