Walks every page of a list call, cursor- or offset-based:
for await (const page of paginate((p) => unet.api.feed({ cursor: p.cursor }))) show(page.posts);for await (const page of paginate((p) => unet.api.followers("alice", { offset: p.offset }))) show(page.users); Copy
for await (const page of paginate((p) => unet.api.feed({ cursor: p.cursor }))) show(page.posts);for await (const page of paginate((p) => unet.api.followers("alice", { offset: p.offset }))) show(page.users);
Stops when the server returns no next position (or the same one twice). maxPages caps the walk.
maxPages
Walks every page of a list call, cursor- or offset-based:
Stops when the server returns no next position (or the same one twice).
maxPagescaps the walk.