source: trip-planner-front/node_modules/rxjs/_esm5/internal/operators/skipWhile.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,_Subscriber PURE_IMPORTS_END */
2import * as tslib_1 from "tslib";
3import { Subscriber } from '../Subscriber';
4export function skipWhile(predicate) {
5 return function (source) { return source.lift(new SkipWhileOperator(predicate)); };
6}
7var SkipWhileOperator = /*@__PURE__*/ (function () {
8 function SkipWhileOperator(predicate) {
9 this.predicate = predicate;
10 }
11 SkipWhileOperator.prototype.call = function (subscriber, source) {
12 return source.subscribe(new SkipWhileSubscriber(subscriber, this.predicate));
13 };
14 return SkipWhileOperator;
15}());
16var SkipWhileSubscriber = /*@__PURE__*/ (function (_super) {
17 tslib_1.__extends(SkipWhileSubscriber, _super);
18 function SkipWhileSubscriber(destination, predicate) {
19 var _this = _super.call(this, destination) || this;
20 _this.predicate = predicate;
21 _this.skipping = true;
22 _this.index = 0;
23 return _this;
24 }
25 SkipWhileSubscriber.prototype._next = function (value) {
26 var destination = this.destination;
27 if (this.skipping) {
28 this.tryCallPredicate(value);
29 }
30 if (!this.skipping) {
31 destination.next(value);
32 }
33 };
34 SkipWhileSubscriber.prototype.tryCallPredicate = function (value) {
35 try {
36 var result = this.predicate(value, this.index++);
37 this.skipping = Boolean(result);
38 }
39 catch (err) {
40 this.destination.error(err);
41 }
42 };
43 return SkipWhileSubscriber;
44}(Subscriber));
45//# sourceMappingURL=skipWhile.js.map
Note: See TracBrowser for help on using the repository browser.