Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow manual pagination of API results #69

Closed
wants to merge 2 commits into from

Conversation

stollr
Copy link
Collaborator

@stollr stollr commented May 16, 2022

Currently it is not able to paginate the results of the API manually. The Pagination trait always iterates over all pages automatically, which is not always desired. I have already created the issue #68.

In my case for example, I want to synchronize a custom member list (see this repo interactively via cli command. I want to compare each person and show the differences between the local and the remote data.

The user should be able to exit the comparison. This is why it would be useless to fetch hundreds of data records if only maybe 10 are needed.

The change is very simple. The pagination trait will check if the options contains a specific page. If any is set it will only load this specific page. Otherwise it will fall back to the previois behaviour and iterate over all pages. So backward compatibility is kept ;-)

I am going to add an explanation to the documentation, too. Aferwards I'll update this PR.

@stollr stollr marked this pull request as ready for review May 16, 2022 21:09
@stollr
Copy link
Collaborator Author

stollr commented May 16, 2022

I have added the docs now. I am looking forward to your feedback ;-)

@DumbergerL DumbergerL linked an issue Jun 3, 2022 that may be closed by this pull request
@DumbergerL
Copy link
Contributor

DumbergerL commented Jun 3, 2022

Further edits: #72

@DumbergerL DumbergerL closed this Jun 3, 2022
@stollr
Copy link
Collaborator Author

stollr commented Jun 3, 2022

Nice. Thank you for reviewing and merging ;-)

@stollr stollr deleted the manual-pagination branch August 22, 2022 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pagination does not work
2 participants