Last change
on this file since fa375fe was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
643 bytes
|
Line | |
---|
1 | import { Subscriber } from '../Subscriber';
|
---|
2 | export function skip(count) {
|
---|
3 | return (source) => source.lift(new SkipOperator(count));
|
---|
4 | }
|
---|
5 | class SkipOperator {
|
---|
6 | constructor(total) {
|
---|
7 | this.total = total;
|
---|
8 | }
|
---|
9 | call(subscriber, source) {
|
---|
10 | return source.subscribe(new SkipSubscriber(subscriber, this.total));
|
---|
11 | }
|
---|
12 | }
|
---|
13 | class 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.