1 | import { AsyncIterableX } from './asynciterablex';
|
2 | export 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 | }
|
15 | export function _concatAll(source) {
|
16 | return new ConcatAsyncIterable(source);
|
17 | }
|
18 |
|
19 | export function concat(source, ...args) {
|
20 | return new ConcatAsyncIterable([source, ...args]);
|
21 | }
|
22 |
|
23 | export function concatStatic(...args) {
|
24 | return new ConcatAsyncIterable(args);
|
25 | }
|
26 |
|
27 |
|