UNPKG

@reactivex/ix-esnext-esm

Version:

The Interactive Extensions for JavaScript

1 lines 1.25 kB
{"version":3,"sources":["iterable/operators/dowhile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGrC;;;;;;;;GAQG;AACH,MAAM,UAAU,OAAO,CAAU,SAAwB;IACvD,OAAO,SAAS,uBAAuB,CAAC,MAAyB;QAC/D,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;IACpD,CAAC,CAAC;AACJ,CAAC","file":"dowhile.js","sourcesContent":["import { IterableX } from '../iterablex';\nimport { concat } from '../concat';\nimport { whileDo } from '../whiledo';\nimport { MonoTypeOperatorFunction } from '../../interfaces';\n\n/**\n * Generates an async-iterable sequence by repeating a source sequence as long as the given loop postcondition holds.\n *\n * @export\n * @template TSource The type of elements in the source sequence.\n * @param {(() => boolean)} condition Loop condition.\n * @returns {MonoTypeOperatorFunction<TSource>} An operator that generates an async-iterable by repeating a\n * source sequence while the postcondition holds.\n */\nexport function doWhile<TSource>(condition: () => boolean): MonoTypeOperatorFunction<TSource> {\n return function doWhileOperatorFunction(source: Iterable<TSource>): IterableX<TSource> {\n return concat(source, whileDo(source, condition));\n };\n}\n"]}