PaginatedResource
A list that arrives one page at a time.
Every all(…, scope) accessor returns one. It is a live object rather than a snapshot: observe state for what to draw, and call loadNextPage as the user reaches the end.
val issues = CGS.content().issues.all(scope = viewModelScope)
issues.state.collect { state ->
render(state.items)
if (state.canLoadMore) issues.loadNextPage()
}Content copied to clipboard
Hold on to the instance for as long as the list is on screen — it is what holds the pages already loaded. Calling all(…) again starts a new list from page one.
The first page is requested when state is first collected, not when the resource is created, and the whole thing follows the active profile — see Content.
Parameters
T
the item type, always the light form of an entity (IssueShort, ArticleShort, …).