UNPKG

457 BJavaScriptView Raw
1import { IterableX } from './iterablex';
2class WhileIterable extends IterableX {
3 constructor(condition, source) {
4 super();
5 this._condition = condition;
6 this._source = source;
7 }
8 *[Symbol.iterator]() {
9 while (this._condition()) {
10 yield* this._source;
11 }
12 }
13}
14export function whileDo(condition, source) {
15 return new WhileIterable(condition, source);
16}
17
18//# sourceMappingURL=whiledo.mjs.map