diff --git a/CHANGELOG.md b/CHANGELOG.md index f56277219be..5491320f880 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## 0.4.6 +* `Pagination` + * `Common` + * `Pagination` got new extension: `Pagination#isFirstPage` + ## 0.4.5 * `Android` diff --git a/pagination/common/src/commonMain/kotlin/dev/inmo/micro_utils/pagination/Pagination.kt b/pagination/common/src/commonMain/kotlin/dev/inmo/micro_utils/pagination/Pagination.kt index adfa364f0fc..69bb2138c64 100644 --- a/pagination/common/src/commonMain/kotlin/dev/inmo/micro_utils/pagination/Pagination.kt +++ b/pagination/common/src/commonMain/kotlin/dev/inmo/micro_utils/pagination/Pagination.kt @@ -22,6 +22,12 @@ interface Pagination { val size: Int } +/** + * Logical shortcut for comparison that page is 0 + */ +inline val Pagination.isFirstPage + get() = page == 0 + /** * First number in index of objects. It can be used as offset for databases or other data sources */