source: trip-planner-front/node_modules/rxjs/_esm2015/internal/operators/skip.js@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 643 bytes
Line 
1import { Subscriber } from '../Subscriber';
2export function skip(count) {
3 return (source) => source.lift(new SkipOperator(count));
4}
5class SkipOperator {
6 constructor(total) {
7 this.total = total;
8 }
9 call(subscriber, source) {
10 return source.subscribe(new SkipSubscriber(subscriber, this.total));
11 }
12}
13class SkipSubscriber extends Subscriber {
14 constructor(destination, total) {
15 super(destination);
16 this.total = total;
17 this.count = 0;
18 }
19 _next(x) {
20 if (++this.count > this.total) {
21 this.destination.next(x);
22 }
23 }
24}
25//# sourceMappingURL=skip.js.map
Note: See TracBrowser for help on using the repository browser.