Skip to content

Conversation

myxoh
Copy link
Contributor

@myxoh myxoh commented Jul 8, 2022

Again doing a few things at once that you likely would want to breakup just to spark the discussion:

Splits Paginator into two classes:

  • Paginator is more of a controller class, and validates params and presents the results to the consumer
  • Page is left as an internal class where the real computation happens, which exposes results like: page (with cursor), records (just the records), page_info (metadata), total

Some other changes:

Of course this is more a draft - no added specs etc.
But I think a few benefits of this approach is to help reduce the class size; help clean up the specs (which right now are all testing the full paginator class and hence tests that should be fast - like validators, still take a lot of setup time)

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.

1 participant