47 lines
1.8 KiB
JavaScript
47 lines
1.8 KiB
JavaScript
|
/** PURE_IMPORTS_START tslib,_innerSubscribe PURE_IMPORTS_END */
|
||
|
import * as tslib_1 from "tslib";
|
||
|
import { SimpleOuterSubscriber, SimpleInnerSubscriber, innerSubscribe } from '../innerSubscribe';
|
||
|
export function skipUntil(notifier) {
|
||
|
return function (source) { return source.lift(new SkipUntilOperator(notifier)); };
|
||
|
}
|
||
|
var SkipUntilOperator = /*@__PURE__*/ (function () {
|
||
|
function SkipUntilOperator(notifier) {
|
||
|
this.notifier = notifier;
|
||
|
}
|
||
|
SkipUntilOperator.prototype.call = function (destination, source) {
|
||
|
return source.subscribe(new SkipUntilSubscriber(destination, this.notifier));
|
||
|
};
|
||
|
return SkipUntilOperator;
|
||
|
}());
|
||
|
var SkipUntilSubscriber = /*@__PURE__*/ (function (_super) {
|
||
|
tslib_1.__extends(SkipUntilSubscriber, _super);
|
||
|
function SkipUntilSubscriber(destination, notifier) {
|
||
|
var _this = _super.call(this, destination) || this;
|
||
|
_this.hasValue = false;
|
||
|
var innerSubscriber = new SimpleInnerSubscriber(_this);
|
||
|
_this.add(innerSubscriber);
|
||
|
_this.innerSubscription = innerSubscriber;
|
||
|
var innerSubscription = innerSubscribe(notifier, innerSubscriber);
|
||
|
if (innerSubscription !== innerSubscriber) {
|
||
|
_this.add(innerSubscription);
|
||
|
_this.innerSubscription = innerSubscription;
|
||
|
}
|
||
|
return _this;
|
||
|
}
|
||
|
SkipUntilSubscriber.prototype._next = function (value) {
|
||
|
if (this.hasValue) {
|
||
|
_super.prototype._next.call(this, value);
|
||
|
}
|
||
|
};
|
||
|
SkipUntilSubscriber.prototype.notifyNext = function () {
|
||
|
this.hasValue = true;
|
||
|
if (this.innerSubscription) {
|
||
|
this.innerSubscription.unsubscribe();
|
||
|
}
|
||
|
};
|
||
|
SkipUntilSubscriber.prototype.notifyComplete = function () {
|
||
|
};
|
||
|
return SkipUntilSubscriber;
|
||
|
}(SimpleOuterSubscriber));
|
||
|
//# sourceMappingURL=skipUntil.js.map
|