Actualizacion maquina principal
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / rxjs / _esm2015 / internal / operators / takeUntil.js
1 import { OuterSubscriber } from '../OuterSubscriber';
2 import { subscribeToResult } from '../util/subscribeToResult';
3 export function takeUntil(notifier) {
4     return (source) => source.lift(new TakeUntilOperator(notifier));
5 }
6 class TakeUntilOperator {
7     constructor(notifier) {
8         this.notifier = notifier;
9     }
10     call(subscriber, source) {
11         const takeUntilSubscriber = new TakeUntilSubscriber(subscriber);
12         const notifierSubscription = subscribeToResult(takeUntilSubscriber, this.notifier);
13         if (notifierSubscription && !takeUntilSubscriber.seenValue) {
14             takeUntilSubscriber.add(notifierSubscription);
15             return source.subscribe(takeUntilSubscriber);
16         }
17         return takeUntilSubscriber;
18     }
19 }
20 class TakeUntilSubscriber extends OuterSubscriber {
21     constructor(destination) {
22         super(destination);
23         this.seenValue = false;
24     }
25     notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) {
26         this.seenValue = true;
27         this.complete();
28     }
29     notifyComplete() {
30     }
31 }
32 //# sourceMappingURL=takeUntil.js.map