source: trip-planner-front/node_modules/rxjs/internal/operators/observeOn.js@ 76712b2

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

initial commit

  • Property mode set to 100644
File size: 3.1 KB
Line 
1"use strict";
2var __extends = (this && this.__extends) || (function () {
3 var extendStatics = function (d, b) {
4 extendStatics = Object.setPrototypeOf ||
5 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7 return extendStatics(d, b);
8 }
9 return function (d, b) {
10 extendStatics(d, b);
11 function __() { this.constructor = d; }
12 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13 };
14})();
15Object.defineProperty(exports, "__esModule", { value: true });
16var Subscriber_1 = require("../Subscriber");
17var Notification_1 = require("../Notification");
18function observeOn(scheduler, delay) {
19 if (delay === void 0) { delay = 0; }
20 return function observeOnOperatorFunction(source) {
21 return source.lift(new ObserveOnOperator(scheduler, delay));
22 };
23}
24exports.observeOn = observeOn;
25var ObserveOnOperator = (function () {
26 function ObserveOnOperator(scheduler, delay) {
27 if (delay === void 0) { delay = 0; }
28 this.scheduler = scheduler;
29 this.delay = delay;
30 }
31 ObserveOnOperator.prototype.call = function (subscriber, source) {
32 return source.subscribe(new ObserveOnSubscriber(subscriber, this.scheduler, this.delay));
33 };
34 return ObserveOnOperator;
35}());
36exports.ObserveOnOperator = ObserveOnOperator;
37var ObserveOnSubscriber = (function (_super) {
38 __extends(ObserveOnSubscriber, _super);
39 function ObserveOnSubscriber(destination, scheduler, delay) {
40 if (delay === void 0) { delay = 0; }
41 var _this = _super.call(this, destination) || this;
42 _this.scheduler = scheduler;
43 _this.delay = delay;
44 return _this;
45 }
46 ObserveOnSubscriber.dispatch = function (arg) {
47 var notification = arg.notification, destination = arg.destination;
48 notification.observe(destination);
49 this.unsubscribe();
50 };
51 ObserveOnSubscriber.prototype.scheduleMessage = function (notification) {
52 var destination = this.destination;
53 destination.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(notification, this.destination)));
54 };
55 ObserveOnSubscriber.prototype._next = function (value) {
56 this.scheduleMessage(Notification_1.Notification.createNext(value));
57 };
58 ObserveOnSubscriber.prototype._error = function (err) {
59 this.scheduleMessage(Notification_1.Notification.createError(err));
60 this.unsubscribe();
61 };
62 ObserveOnSubscriber.prototype._complete = function () {
63 this.scheduleMessage(Notification_1.Notification.createComplete());
64 this.unsubscribe();
65 };
66 return ObserveOnSubscriber;
67}(Subscriber_1.Subscriber));
68exports.ObserveOnSubscriber = ObserveOnSubscriber;
69var ObserveOnMessage = (function () {
70 function ObserveOnMessage(notification, destination) {
71 this.notification = notification;
72 this.destination = destination;
73 }
74 return ObserveOnMessage;
75}());
76exports.ObserveOnMessage = ObserveOnMessage;
77//# sourceMappingURL=observeOn.js.map
Note: See TracBrowser for help on using the repository browser.