mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2025-10-24 08:40:46 +00:00
rework of PagedComponent
This commit is contained in:
@@ -32,7 +32,7 @@ data class PaginationResult<T>(
|
||||
page: Int,
|
||||
results: List<T>,
|
||||
pagesNumber: Int,
|
||||
size: Int
|
||||
size: Int = results.size
|
||||
) : this(
|
||||
page,
|
||||
size,
|
||||
|
||||
@@ -26,6 +26,16 @@ inline fun Pagination.nextPage() =
|
||||
size
|
||||
)
|
||||
|
||||
/**
|
||||
* This method DO NOT check [Pagination.page] of receiver. Returns pagination for previous page
|
||||
*/
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
inline fun Pagination.previousPage() =
|
||||
SimplePagination(
|
||||
page - 1,
|
||||
size
|
||||
)
|
||||
|
||||
/**
|
||||
* @param page Current page number
|
||||
* @param size Current page size
|
||||
|
||||
Reference in New Issue
Block a user