generating pagination can be simple but a quite tedious job. what if turtle-express expose a helper function that will accept totalCount, limit, page as arguments and calculate the totalPage, prevPage, nextPage, currentPage for the api consumers and also for the backend it could provide the prevOffset, nextOffset, currentOffset, lastOffset and so on.
generating pagination can be simple but a quite tedious job. what if
turtle-express
expose a helper function that will accepttotalCount
,limit
,page
as arguments and calculate thetotalPage
,prevPage
,nextPage
,currentPage
for the api consumers and also for the backend it could provide theprevOffset
,nextOffset
,currentOffset
,lastOffset
and so on.