All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.io.github.ahmad_hamwi.compose.pagination.PaginationInternalState.kt Maven / Gradle / Ivy

package io.github.ahmad_hamwi.compose.pagination

internal sealed class PaginationInternalState(
    open val initialPageKey: KEY,
    open val items: List?,
) {
    class Initial(
        override val initialPageKey: KEY,
        override val items: List? = null,
    ) : PaginationInternalState(initialPageKey, null)

    class Loading(
        override val initialPageKey: KEY,
        override val requestedPageKey: KEY,
        override val items: List? = null,
    ) : PaginationInternalState(initialPageKey, items), IHasRequestedPageKey

    class Loaded(
        override val initialPageKey: KEY,
        override val requestedPageKey: KEY,
        val nextPageKey: KEY,
        override val items: List,
        val isLastPage: Boolean,
    ) : PaginationInternalState(initialPageKey, items), IHasRequestedPageKey

    class Error(
        override val initialPageKey: KEY,
        override val requestedPageKey: KEY,
        val exception: Exception,
        override val items: List? = null,
    ) : PaginationInternalState(initialPageKey, items), IHasRequestedPageKey

    interface IHasRequestedPageKey {
        val requestedPageKey: KEY
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy