Paged Data
A class that represents a paginated data. Used to load data in chunks.
If the data is continuous, use Continuous.
val data = PagedData.Continuous { continuation ->
val (tracks, nextContinuation) = api.loadTracks(continuation)
Page(tracks, nextContinuation)
}Content copied to clipboard
If the data is not continuous, you can just use Single.
val data = PagedData.Single { api.loadTracks() }Content copied to clipboard
If you want to concatenate multiple paged data, use Concat.
val data = PagedData.Concat(
PagedData.Single { api.loadTracks() },
PagedData.Continuous { api.loadTracksPage(it) }
// Add more sources here
)Content copied to clipboard
Parameters
T
The type of data
Inheritors
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun <T : Any> PagedData<T>.toFeedData(buttons: Feed.Buttons? = null, background: ImageHolder? = null): Feed.Data<T>