cloudydeno / deno-aws_api

From-scratch Typescript client for accessing AWS APIs
https://deno.land/x/aws_api
59 stars 3 forks source link

AsyncGenerator functions for API Pagination #1

Open danopia opened 3 years ago

danopia commented 3 years ago

There is some choice of style here:

  1. Do the funcs yield each page's response in its entirety?
  2. Do the funcs yield each inner item individually, hiding the page concept?
  3. Should both styles be implemented for extra flexibility?

My instinct is that it's pretty easy to write a custom loop if visibility of the full pages are required, so the convenience functions should hide the pages. But I could be convinced otherwise I think.