You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's a common implementation to use pager logic but I'm not super fond of it.
Actually, I don't mind handling skip=pageSize*page front end side.
One simple use case I dislike in page=2 logic is when user changes pageSize.
Trying to guess what page we should go to, and where in the page it'll find the records that where visible at time of page size change. (so easy to simply reuse the current skip)
On the other hand, something I really appreciate to have in the api response is a hasMore or endOfRecords boolean.
As I'm considering using this crud module on a personal project, I thought I could offer to contribute by first adding a few things on the roadmap (and hopefully give a hand).
Suggestions
Add a hasMore boolean in the response
Add the ability to use skip/take pagination logic
exposing takeskip in all responses. (?)
if page and take/skip present in request throw error.
Take advantage of cursor logic
this would imply checking orderBy is on a unique key.
Implementing cursor logic would probably be to challenging for me...
The text was updated successfully, but these errors were encountered:
cantoute
changed the title
suggestion on pagination
Suggestion: pagination + take/skip + hasMore + cursor
Aug 31, 2022
It's a common implementation to use pager logic but I'm not super fond of it.
Actually, I don't mind handling
skip=pageSize*page
front end side.One simple use case I dislike in
page=2
logic is when user changes pageSize.Trying to guess what page we should go to, and where in the page it'll find the records that where visible at time of page size change. (so easy to simply reuse the current
skip
)On the other hand, something I really appreciate to have in the api response is a
hasMore
orendOfRecords
boolean.As I'm considering using this crud module on a personal project, I thought I could offer to contribute by first adding a few things on the roadmap (and hopefully give a hand).
Suggestions
hasMore
boolean in the responsetake
skip
in all responses. (?)page
andtake/skip
present in request throw error.orderBy
is on a unique key.Implementing cursor logic would probably be to challenging for me...
The text was updated successfully, but these errors were encountered: