UNPKG

@reactivex/ix-esnext-esm

Version:

The Interactive Extensions for JavaScript

22 lines (20 loc) 519 B
import { IterableX } from '../iterablex'; export class ReverseIterable extends IterableX { constructor(source) { super(); this._source = source; } *[Symbol.iterator]() { const results = []; for (const item of this._source) { results.unshift(item); } yield* results; } } export function reverse() { return function reverseOperatorFunction(source) { return new ReverseIterable(source); }; } //# sourceMappingURL=reverse.mjs.map