UNPKG

626 BJavaScriptView Raw
1import { AsyncIterableX } from './asynciterablex';
2export class SkipUntilAsyncIterable extends AsyncIterableX {
3 constructor(source, other) {
4 super();
5 this._source = source;
6 this._other = other;
7 }
8 async *[Symbol.asyncIterator]() {
9 let otherDone = false;
10 this._other().then(() => (otherDone = true));
11 for await (let item of this._source) {
12 if (otherDone) {
13 yield item;
14 }
15 }
16 }
17}
18export function skipUntil(source, other) {
19 return new SkipUntilAsyncIterable(source, other);
20}
21
22//# sourceMappingURL=skipuntil.mjs.map