First of all, very nice pagination implementation!
Would it be possible to add pageSize / perPage property to the paginated response? Also, in line with currentPage, previousPage, nextPage variables, maybe pageCount can be renamed to lastPage, or in line with totalCount -> totalPages?
// Suggested:
{
pageSize: 10, // <- Added
currentPage: 2,
isFirstPage: false,
isLastPage: false,
previousPage: 1,
nextPage: 3,
lastPage: 10, // or totalPages <- Updated
totalCount: 100
}
lastPage could be calculated using `Math.ceil(total / perPage)`
Also, perhaps the return format can be updated like so:
First of all, very nice pagination implementation!
Would it be possible to add
pageSize
/perPage
property to the paginated response? Also, in line withcurrentPage
,previousPage
,nextPage
variables, maybepageCount
can be renamed tolastPage
, or in line withtotalCount
->totalPages
?Also, perhaps the return format can be updated like so:
Thank you!