-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
JavaScript/TypeScript has the concept of Generator https://www.typescriptlang.org/docs/handbook/iterators-and-generators.html#handbook-content
It is also possible to have async generators.
Having generator would:
- reduce memory consumption. Instead of having big arrays of all data, we would be able to process small chunk of data
- speed things: instead of waiting to retrieve all data, we could start the processing as soon as the first item are retrieved.
A generic generator would share a lot of code with Paginator, as it would "just" yield data instead of concatenating/pushing data (cf.
typescript-sdk/sdk-output/paginator.ts
Line 65 in 0956b79
| modified.push.apply(modified, results.data); |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels