Skip to content

Suggestion: rename pagination() to pagination.each() #1195

@fiznool

Description

@fiznool

What problem are you trying to solve?

Clear up any misunderstanding in the pagination API, specifically the difference between pagination and pagination.all.

Describe the feature

Remaning pagination to pagination.each. The two methods will then reflect their mode of operation:

  • .all: fetches all results from the API, recursively paginating if necessary. Returns a promise which resolves to the full list of results.
  • .each: returns an async iterator, which allows you to iterate over the results using for await syntax. Similar in concept to streaming, used when you expect more results than can feasibly fit in memory at once.

Note this is simply a proposal to change nomenclature - the actual features remain the same.

Related discussion: #1052 (comment)

Checklist

  • I have read the documentation and made sure this feature doesn't already exist.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions