1 | import { AsyncIterableX } from './asynciterablex';
|
2 | class AnonymousAsyncIterable extends AsyncIterableX {
|
3 | constructor(fn) {
|
4 | super();
|
5 | this._fn = fn;
|
6 | }
|
7 | async *[Symbol.asyncIterator]() {
|
8 | const it = await this._fn();
|
9 | let next;
|
10 | while (!(next = await it.next()).done) {
|
11 | yield next.value;
|
12 | }
|
13 | }
|
14 | }
|
15 | export function create(fn) {
|
16 | return new AnonymousAsyncIterable(fn);
|
17 | }
|
18 |
|
19 | //# sourceMappingURL=create.mjs.map
|