Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

skip.js 643B

12345678910111213141516171819202122232425
  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