frontend/.pnpm-store/v3/files/6c/abd2b5643a94f0503e593986b3775240d1ddf2124afcfaf7919bd406798d0df4d02654cb4c489971eed43615f54793877bcee0be7e2b92e52887ab680f5f03

46 lines
1.6 KiB
Plaintext

/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
import * as tslib_1 from "tslib";
import { Subscriber } from '../Subscriber';
export function skipWhile(predicate) {
return function (source) { return source.lift(new SkipWhileOperator(predicate)); };
}
var SkipWhileOperator = /*@__PURE__*/ (function () {
function SkipWhileOperator(predicate) {
this.predicate = predicate;
}
SkipWhileOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new SkipWhileSubscriber(subscriber, this.predicate));
};
return SkipWhileOperator;
}());
var SkipWhileSubscriber = /*@__PURE__*/ (function (_super) {
tslib_1.__extends(SkipWhileSubscriber, _super);
function SkipWhileSubscriber(destination, predicate) {
var _this = _super.call(this, destination) || this;
_this.predicate = predicate;
_this.skipping = true;
_this.index = 0;
return _this;
}
SkipWhileSubscriber.prototype._next = function (value) {
var destination = this.destination;
if (this.skipping) {
this.tryCallPredicate(value);
}
if (!this.skipping) {
destination.next(value);
}
};
SkipWhileSubscriber.prototype.tryCallPredicate = function (value) {
try {
var result = this.predicate(value, this.index++);
this.skipping = Boolean(result);
}
catch (err) {
this.destination.error(err);
}
};
return SkipWhileSubscriber;
}(Subscriber));
//# sourceMappingURL=skipWhile.js.map