@dmgt/google-ad-manager-api
Version:
Typed Google Ad Manager API
28 lines • 692 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.iterate = iterate;
const paginate_1 = require("./paginate");
/**
* Iterate through results of possibly inifite, paginated queries.
*
* @see {@link PaginateOptions}
* @see {@link paginate}
* @example
* ```
* for await (const item of iterate({
* executeQuery: (limit, offset) =>
* query(
* client,
* 'getLineItemsByStatementAsync',
* { limit, offset }
* )
* })) {
* console.info(item)
* }
* ```
*/
async function* iterate(options) {
for await (const { items } of (0, paginate_1.paginate)(options))
yield* items;
}
//# sourceMappingURL=iterate.js.map