Every new change
This commit is contained in:
32
node_modules/rxjs/_esm2015/internal/operators/takeUntil.js
generated
vendored
Normal file
32
node_modules/rxjs/_esm2015/internal/operators/takeUntil.js
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
import { OuterSubscriber } from '../OuterSubscriber';
|
||||
import { subscribeToResult } from '../util/subscribeToResult';
|
||||
export function takeUntil(notifier) {
|
||||
return (source) => source.lift(new TakeUntilOperator(notifier));
|
||||
}
|
||||
class TakeUntilOperator {
|
||||
constructor(notifier) {
|
||||
this.notifier = notifier;
|
||||
}
|
||||
call(subscriber, source) {
|
||||
const takeUntilSubscriber = new TakeUntilSubscriber(subscriber);
|
||||
const notifierSubscription = subscribeToResult(takeUntilSubscriber, this.notifier);
|
||||
if (notifierSubscription && !takeUntilSubscriber.seenValue) {
|
||||
takeUntilSubscriber.add(notifierSubscription);
|
||||
return source.subscribe(takeUntilSubscriber);
|
||||
}
|
||||
return takeUntilSubscriber;
|
||||
}
|
||||
}
|
||||
class TakeUntilSubscriber extends OuterSubscriber {
|
||||
constructor(destination) {
|
||||
super(destination);
|
||||
this.seenValue = false;
|
||||
}
|
||||
notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) {
|
||||
this.seenValue = true;
|
||||
this.complete();
|
||||
}
|
||||
notifyComplete() {
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=takeUntil.js.map
|
Reference in New Issue
Block a user