commonMain.ru.astrainteractive.klibs.paging.IntPagerCollector.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of paging-jvm Show documentation
Show all versions of paging-jvm Show documentation
Kotlin Multiplatform paging library
package ru.astrainteractive.klibs.paging
import ru.astrainteractive.klibs.paging.context.IntPageContext
import ru.astrainteractive.klibs.paging.data.PagedListDataSource
import ru.astrainteractive.klibs.paging.state.PagingState
/**
* This is a default implementation for Integer page. You can define your own by delegation just like that
*/
class IntPagerCollector(
private val initialPage: Int = 0,
private val pageSize: Int = 10,
private val pager: PagedListDataSource,
) : PagingCollector by DefaultPagingCollector(
initialPagingStateFactory = {
PagingState(
pageContext = IntPageContext(page = initialPage),
items = emptyList(),
pageSizeAtLeast = pageSize,
isLastPage = false,
isLoading = false,
isFailure = false
)
},
pager = pager,
pageContextFactory = IntPageContext.Factory
)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy