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

Auto pagination #12

Open
mgmarlow opened this issue Aug 24, 2022 · 0 comments
Open

Auto pagination #12

mgmarlow opened this issue Aug 24, 2022 · 0 comments

Comments

@mgmarlow
Copy link
Owner

mgmarlow commented Aug 24, 2022

Working with pagination is a very manual process that requires lots of consumer code. See example, #11. Some best practices should be baked into the library:

  • Handling Notion rate limit errors
  • Max # of retries (configurable)
  • Respectful default sleeps in-between requests (configurable)

I think a great example of this is the Stripe API auto pagination, source.

Create a new method, #auto_paging_each, on the Notion::List object to support auto-iterating through multiple pages.

notion_client.search(search_params).auto_paging_each do |data|
  ...
end
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

No branches or pull requests

1 participant