skipUntil.js
1.26 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
import { SimpleOuterSubscriber, SimpleInnerSubscriber, innerSubscribe } from '../innerSubscribe';
export function skipUntil(notifier) {
return (source) => source.lift(new SkipUntilOperator(notifier));
}
class SkipUntilOperator {
constructor(notifier) {
this.notifier = notifier;
}
call(destination, source) {
return source.subscribe(new SkipUntilSubscriber(destination, this.notifier));
}
}
class SkipUntilSubscriber extends SimpleOuterSubscriber {
constructor(destination, notifier) {
super(destination);
this.hasValue = false;
const innerSubscriber = new SimpleInnerSubscriber(this);
this.add(innerSubscriber);
this.innerSubscription = innerSubscriber;
const innerSubscription = innerSubscribe(notifier, innerSubscriber);
if (innerSubscription !== innerSubscriber) {
this.add(innerSubscription);
this.innerSubscription = innerSubscription;
}
}
_next(value) {
if (this.hasValue) {
super._next(value);
}
}
notifyNext() {
this.hasValue = true;
if (this.innerSubscription) {
this.innerSubscription.unsubscribe();
}
}
notifyComplete() {
}
}
//# sourceMappingURL=skipUntil.js.map