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