wishthis/node_modules/rxjs/_esm2015/internal/operators/skipUntil.js

40 lines
1.3 KiB
JavaScript
Raw Normal View History

2022-01-21 08:28:41 +00:00
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