Concat

class Concat<T : Any>(sources: PagedData<T>) : PagedData<T>

A class representing a concatenation of multiple data sources.

This class is used to concatenate multiple data sources into a single source. It takes multiple PagedData sources and loads them one after the other.

Example:

val data = PagedData.Concat(
PagedData.Single { api.loadShelves() },
PagedData.Continuous { api.loadShelvesPage(it) },
// Add more sources here
)

Parameters

sources

The list of PagedData sources to concatenate

Constructors

Link copied to clipboard
constructor(vararg sources: PagedData<T>)

Functions

Link copied to clipboard
open override fun clear(): <Error class: unknown class>

To clear all the cache of paged data

Link copied to clipboard
open override fun invalidate(continuation: String?)
Link copied to clipboard
suspend fun loadAll(): List<T>

To load all the data

Link copied to clipboard
open suspend override fun loadAllInternal(): List<T>
Link copied to clipboard
open suspend override fun loadListInternal(continuation: String?): Page<T>
Link copied to clipboard
suspend fun loadPage(continuation: String?): Page<T>
Link copied to clipboard
open override fun <R : Any> map(block: suspend (<Error class: unknown class><List<T>>) -> List<R>): PagedData<R>
Link copied to clipboard
fun <T : Any> PagedData<T>.toFeed(buttons: Feed.Buttons? = null, background: ImageHolder? = null): Feed<T>

Convenience function to create a Feed from a PagedData of T items.

Link copied to clipboard
fun <T : Any> PagedData<T>.toFeedData(buttons: Feed.Buttons? = null, background: ImageHolder? = null): Feed.Data<T>

Convenience function to convert a PagedData to a Feed.Data.