drewolson / scrivener

Pagination for the Elixir ecosystem

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Offset/Limit support

fbjork opened this issue · comments

Any chance we could get offset and limit support added?

Is there something these attributes would provide that page and page_size don't currently provide? Are they just aliases?

@drewolson page_size is an alias, but offset would have to be calculated every time.

offset would be page - 1 * page_size.

Not hard to do, but would be nice to have the option to chose pagination style.

@fbjork I've toyed around with the idea a bit, but it seems to be pretty orthogonal to the current way we're preforming pagination. Perhaps there could be a different function added to the repository responsible for this, something like window? If you're interesting, I'd like to see a PR so that I can have a more concrete discussion about it.

Closing this for now, please open a PR if you'd like to continue the discussion.