UNPKG

@reactivex/ix-esnext-esm

Version:

The Interactive Extensions for JavaScript

18 lines (16 loc) 727 B
import { concat } from '../concat.js'; import { whileDo } from '../whiledo.js'; /** * Generates an async-iterable sequence by repeating a source sequence as long as the given loop postcondition holds. * * @template TSource The type of elements in the source sequence. * @param {((signal?: AbortSignal) => boolean | Promise<boolean>)} condition Loop condition. * @returns {MonoTypeOperatorAsyncFunction<TSource>} An operator that generates an async-iterable by repeating a * source sequence while the postcondition holds. */ export function doWhile(condition) { return function doWhileOperatorFunction(source) { return concat(source, whileDo(source, condition)); }; } //# sourceMappingURL=dowhile.js.map