3 ms·
Agreed! We do this in Notion's public API library: for await (const block of iteratePaginatedAPI(notion.blocks.children.list, { block_id: parentBlock
by jitl 4y ago
Agreed! We do this in Notion's public API library:
for await (const block of iteratePaginatedAPI(notion.blocks.children.list, {
block_id: parentBlockId,
})) {
// Do something with block.
}
Implemented here: https://github.com/makenotion/notion-sdk-js/blob/90418939a90aa04f52e7bb9b15444cd77b29cc03/src/helpers.ts#L25-L57 https://github.com/makenotion/notion-sdk-js/blob/90418939a90...