skipUntil.js
1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/** 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