source: trip-planner-front/node_modules/rxjs/_esm5/internal/operators/observeOn.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: 2.6 KB
Line 
1/** PURE_IMPORTS_START tslib,_Subscriber,_Notification PURE_IMPORTS_END */
2import * as tslib_1 from "tslib";
3import { Subscriber } from '../Subscriber';
4import { Notification } from '../Notification';
5export function observeOn(scheduler, delay) {
6 if (delay === void 0) {
7 delay = 0;
8 }
9 return function observeOnOperatorFunction(source) {
10 return source.lift(new ObserveOnOperator(scheduler, delay));
11 };
12}
13var ObserveOnOperator = /*@__PURE__*/ (function () {
14 function ObserveOnOperator(scheduler, delay) {
15 if (delay === void 0) {
16 delay = 0;
17 }
18 this.scheduler = scheduler;
19 this.delay = delay;
20 }
21 ObserveOnOperator.prototype.call = function (subscriber, source) {
22 return source.subscribe(new ObserveOnSubscriber(subscriber, this.scheduler, this.delay));
23 };
24 return ObserveOnOperator;
25}());
26export { ObserveOnOperator };
27var ObserveOnSubscriber = /*@__PURE__*/ (function (_super) {
28 tslib_1.__extends(ObserveOnSubscriber, _super);
29 function ObserveOnSubscriber(destination, scheduler, delay) {
30 if (delay === void 0) {
31 delay = 0;
32 }
33 var _this = _super.call(this, destination) || this;
34 _this.scheduler = scheduler;
35 _this.delay = delay;
36 return _this;
37 }
38 ObserveOnSubscriber.dispatch = function (arg) {
39 var notification = arg.notification, destination = arg.destination;
40 notification.observe(destination);
41 this.unsubscribe();
42 };
43 ObserveOnSubscriber.prototype.scheduleMessage = function (notification) {
44 var destination = this.destination;
45 destination.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(notification, this.destination)));
46 };
47 ObserveOnSubscriber.prototype._next = function (value) {
48 this.scheduleMessage(Notification.createNext(value));
49 };
50 ObserveOnSubscriber.prototype._error = function (err) {
51 this.scheduleMessage(Notification.createError(err));
52 this.unsubscribe();
53 };
54 ObserveOnSubscriber.prototype._complete = function () {
55 this.scheduleMessage(Notification.createComplete());
56 this.unsubscribe();
57 };
58 return ObserveOnSubscriber;
59}(Subscriber));
60export { ObserveOnSubscriber };
61var ObserveOnMessage = /*@__PURE__*/ (function () {
62 function ObserveOnMessage(notification, destination) {
63 this.notification = notification;
64 this.destination = destination;
65 }
66 return ObserveOnMessage;
67}());
68export { ObserveOnMessage };
69//# sourceMappingURL=observeOn.js.map
Note: See TracBrowser for help on using the repository browser.