UNPKG

@reactivex/ix-esnext-esm

Version:

The Interactive Extensions for JavaScript

29 lines (27 loc) 733 B
import { IterableX } from '../iterablex'; export class SkipIterable extends IterableX { constructor(source, count) { super(); this._source = source; this._count = count; } *[Symbol.iterator]() { const it = this._source[Symbol.iterator](); let count = this._count; let next; while (count > 0 && !(next = it.next()).done) { count--; } if (count <= 0) { while (!(next = it.next()).done) { yield next.value; } } } } export function skip(count) { return function skipOperatorFunction(source) { return new SkipIterable(source, count); }; } //# sourceMappingURL=skip.mjs.map