source: trip-planner-front/node_modules/rxjs/_esm5/internal/testing/HotObservable.js

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: 1.6 KB
Line 
1/** PURE_IMPORTS_START tslib,_Subject,_Subscription,_SubscriptionLoggable,_util_applyMixins PURE_IMPORTS_END */
2import * as tslib_1 from "tslib";
3import { Subject } from '../Subject';
4import { Subscription } from '../Subscription';
5import { SubscriptionLoggable } from './SubscriptionLoggable';
6import { applyMixins } from '../util/applyMixins';
7var HotObservable = /*@__PURE__*/ (function (_super) {
8 tslib_1.__extends(HotObservable, _super);
9 function HotObservable(messages, scheduler) {
10 var _this = _super.call(this) || this;
11 _this.messages = messages;
12 _this.subscriptions = [];
13 _this.scheduler = scheduler;
14 return _this;
15 }
16 HotObservable.prototype._subscribe = function (subscriber) {
17 var subject = this;
18 var index = subject.logSubscribedFrame();
19 var subscription = new Subscription();
20 subscription.add(new Subscription(function () {
21 subject.logUnsubscribedFrame(index);
22 }));
23 subscription.add(_super.prototype._subscribe.call(this, subscriber));
24 return subscription;
25 };
26 HotObservable.prototype.setup = function () {
27 var subject = this;
28 var messagesLength = subject.messages.length;
29 for (var i = 0; i < messagesLength; i++) {
30 (function () {
31 var message = subject.messages[i];
32 subject.scheduler.schedule(function () { message.notification.observe(subject); }, message.frame);
33 })();
34 }
35 };
36 return HotObservable;
37}(Subject));
38export { HotObservable };
39/*@__PURE__*/ applyMixins(HotObservable, [SubscriptionLoggable]);
40//# sourceMappingURL=HotObservable.js.map
Note: See TracBrowser for help on using the repository browser.