source: trip-planner-front/node_modules/rxjs/_esm5/internal/operators/exhaust.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,_innerSubscribe PURE_IMPORTS_END */
2import * as tslib_1 from "tslib";
3import { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';
4export function exhaust() {
5 return function (source) { return source.lift(new SwitchFirstOperator()); };
6}
7var SwitchFirstOperator = /*@__PURE__*/ (function () {
8 function SwitchFirstOperator() {
9 }
10 SwitchFirstOperator.prototype.call = function (subscriber, source) {
11 return source.subscribe(new SwitchFirstSubscriber(subscriber));
12 };
13 return SwitchFirstOperator;
14}());
15var SwitchFirstSubscriber = /*@__PURE__*/ (function (_super) {
16 tslib_1.__extends(SwitchFirstSubscriber, _super);
17 function SwitchFirstSubscriber(destination) {
18 var _this = _super.call(this, destination) || this;
19 _this.hasCompleted = false;
20 _this.hasSubscription = false;
21 return _this;
22 }
23 SwitchFirstSubscriber.prototype._next = function (value) {
24 if (!this.hasSubscription) {
25 this.hasSubscription = true;
26 this.add(innerSubscribe(value, new SimpleInnerSubscriber(this)));
27 }
28 };
29 SwitchFirstSubscriber.prototype._complete = function () {
30 this.hasCompleted = true;
31 if (!this.hasSubscription) {
32 this.destination.complete();
33 }
34 };
35 SwitchFirstSubscriber.prototype.notifyComplete = function () {
36 this.hasSubscription = false;
37 if (this.hasCompleted) {
38 this.destination.complete();
39 }
40 };
41 return SwitchFirstSubscriber;
42}(SimpleOuterSubscriber));
43//# sourceMappingURL=exhaust.js.map
Note: See TracBrowser for help on using the repository browser.