@itwin/insights-client
Version:
Insights client for the iTwin platform
20 lines • 597 B
JavaScript
export class EntityPageListIterator {
constructor(pageQueryFunc) {
this._entityPages = this.queryPages(pageQueryFunc);
}
[Symbol.asyncIterator]() {
return this;
}
async next() {
return this._entityPages.next();
}
async *queryPages(pageQueryFunc) {
let nextPageQueryFunc = pageQueryFunc;
while (nextPageQueryFunc) {
const entityPage = await nextPageQueryFunc();
nextPageQueryFunc = entityPage.next;
yield entityPage.entities;
}
}
}
//# sourceMappingURL=EntityPageListIterator.js.map