minor adjustment to readme
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / rxjs / _esm2015 / internal / operators / skipWhile.js
1 import { Subscriber } from '../Subscriber';
2 export function skipWhile(predicate) {
3     return (source) => source.lift(new SkipWhileOperator(predicate));
4 }
5 class SkipWhileOperator {
6     constructor(predicate) {
7         this.predicate = predicate;
8     }
9     call(subscriber, source) {
10         return source.subscribe(new SkipWhileSubscriber(subscriber, this.predicate));
11     }
12 }
13 class SkipWhileSubscriber extends Subscriber {
14     constructor(destination, predicate) {
15         super(destination);
16         this.predicate = predicate;
17         this.skipping = true;
18         this.index = 0;
19     }
20     _next(value) {
21         const destination = this.destination;
22         if (this.skipping) {
23             this.tryCallPredicate(value);
24         }
25         if (!this.skipping) {
26             destination.next(value);
27         }
28     }
29     tryCallPredicate(value) {
30         try {
31             const result = this.predicate(value, this.index++);
32             this.skipping = Boolean(result);
33         }
34         catch (err) {
35             this.destination.error(err);
36         }
37     }
38 }
39 //# sourceMappingURL=skipWhile.js.map