@reactivex/ix-esnext-esm
Version:
The Interactive Extensions for JavaScript
20 lines (18 loc) • 474 B
JavaScript
import { AsyncIterableX } from './asynciterablex';
class AnonymousAsyncIterable extends AsyncIterableX {
constructor(fn) {
super();
this._fn = fn;
}
async *[Symbol.asyncIterator]() {
const it = await this._fn();
let next;
while (!(next = await it.next()).done) {
yield next.value;
}
}
}
export function create(fn) {
return new AnonymousAsyncIterable(fn);
}
//# sourceMappingURL=create.mjs.map