UNPKG

748 BJavaScriptView Raw
1import { AsyncIterableX } from './asynciterablex';
2export class ConcatAsyncIterable extends AsyncIterableX {
3 constructor(source) {
4 super();
5 this._source = source;
6 }
7 async *[Symbol.asyncIterator]() {
8 for (let outer of this._source) {
9 for await (let item of outer) {
10 yield item;
11 }
12 }
13 }
14}
15export function _concatAll(source) {
16 return new ConcatAsyncIterable(source);
17}
18/* tslint:enable:max-line-length */
19export function concat(source, ...args) {
20 return new ConcatAsyncIterable([source, ...args]);
21}
22/* tslint:enable:max-line-length */
23export function concatStatic(...args) {
24 return new ConcatAsyncIterable(args);
25}
26
27//# sourceMappingURL=concat.mjs.map