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 | let it = await this._fn(), next;
|
9 | while (!(next = await it.next()).done) {
|
10 | yield next.value;
|
11 | }
|
12 | }
|
13 | }
|
14 | export function create(fn) {
|
15 | return new AnonymousAsyncIterable(fn);
|
16 | }
|
17 |
|
18 | //# sourceMappingURL=create.mjs.map
|