Skip to content
This repository has been archived by the owner on Aug 27, 2019. It is now read-only.

Helper to retrieve all pages #18

Open
2 tasks
cben opened this issue Apr 30, 2019 · 0 comments
Open
2 tasks

Helper to retrieve all pages #18

cben opened this issue Apr 30, 2019 · 0 comments

Comments

@cben
Copy link
Contributor

cben commented Apr 30, 2019

Retrieving all pages is somewhat cumbersome - #11 - but for most programmatic uses it's the only correct way to use the API
(well, it's tempting to just request huge page size, but that's not really "correct", and there's been an idea that API might limit page size in future?)

So maybe the SDK could offer a helper that iterates all data.

  • should it concatenate everything to one array? Or return some kind of iterator you can start consuming? Maybe a channel?

  • requesting multiple pages in jumps risks missing/duplicating items if underlying collection is mutated in between. The SDK can't really solve this; but maybe we should think how to improve this on API side before abstracting a risky pattern in SDK...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant