1 | import { AsyncIterableX } from './asynciterablex';
|
2 | import { wrapWithAbort } from './operators/withabort';
|
3 | import { throwIfAborted } from '../aborterror';
|
4 | export class ConcatAsyncIterable extends AsyncIterableX {
|
5 | constructor(source) {
|
6 | super();
|
7 | this._source = source;
|
8 | }
|
9 | async *[Symbol.asyncIterator](signal) {
|
10 | throwIfAborted(signal);
|
11 | for (const outer of this._source) {
|
12 | for await (const item of wrapWithAbort(outer, signal)) {
|
13 | yield item;
|
14 | }
|
15 | }
|
16 | }
|
17 | }
|
18 | export function _concatAll(source) {
|
19 | return new ConcatAsyncIterable(source);
|
20 | }
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | export function concat(...args) {
|
31 | return new ConcatAsyncIterable(args);
|
32 | }
|
33 |
|
34 |
|