notion-sdk-ruby
notion-sdk-ruby copied to clipboard
Auto pagination
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