Skip to content

Generator in addition to Paginator #29

@yannick-beot-sp

Description

@yannick-beot-sp

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:

  1. reduce memory consumption. Instead of having big arrays of all data, we would be able to process small chunk of data
  2. 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.

modified.push.apply(modified, results.data);
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions