Pageable

interface Pageable<Key : Any, PageItem>

Represents a paginated data source with flattened items and fetching state.

The item list automatically updates as pages are fetched based on the configured strategy.

Properties

Link copied to clipboard
abstract val isFetchingNext: StateFlow<Boolean>
Link copied to clipboard
abstract val isFetchingPrevious: StateFlow<Boolean>
Link copied to clipboard
abstract val items: StateFlow<List<PageItem>>

Functions

Link copied to clipboard
abstract suspend fun _onEvent(event: PageDisplayingEvent<Key>)
Link copied to clipboard
abstract suspend fun getPageKeyForItem(item: PageItem): Key?

Maps an item back to its page key. Returns null if the item isn't associated with a page.

Link copied to clipboard
abstract suspend fun jumpTo(page: Key): List<PageItem>?

Loads and activates the specified page, returning its items. Subsequent fetches will be centered around this page.

Link copied to clipboard
abstract fun pageItemKey(item: PageItem): Any

Provides key for an item from any loaded page. See pageable.