import { IterableX } from '../iterablex.js'; import { MonoTypeOperatorFunction } from '../../interfaces.js'; /** @ignore */ export class IgnoreElementsIterable extends IterableX { private _source: Iterable; constructor(source: Iterable) { super(); this._source = source; } *[Symbol.iterator](): Iterator { const it = this._source[Symbol.iterator](); while (!it.next().done) { /* intentionally empty */ } } } /** * Ignores all elements in an iterable sequence leaving only the termination messages. * * @template TSource The type of the elements in the source sequence * @returns {MonoTypeOperatorFunction} An operator that returns an empty iterable sequence * that signals termination, successful or exceptional, of the source sequence. */ export function ignoreElements(): MonoTypeOperatorFunction { return function ignoreElementsOperatorFunction(source: Iterable): IterableX { return new IgnoreElementsIterable(source); }; }