UNPKG

559 BJavaScriptView Raw
1import { AsyncIterableX } from './asynciterablex';
2export class StartWithAsyncIterable extends AsyncIterableX {
3 constructor(source, args) {
4 super();
5 this._source = source;
6 this._args = args;
7 }
8 async *[Symbol.asyncIterator]() {
9 for (let x of this._args) {
10 yield x;
11 }
12 for await (let item of this._source) {
13 yield item;
14 }
15 }
16}
17export function startWith(source, ...args) {
18 return new StartWithAsyncIterable(source, args);
19}
20
21//# sourceMappingURL=startwith.mjs.map