{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}
class CombinedLoadStates
Collection of pagination LoadState
s for both a PagingSource
, and RemoteMediator
.
Public properties |
|
---|---|
LoadState |
Convenience for combined behavior of |
LoadStates? |
|
LoadState |
Convenience for combined behavior of |
LoadState |
Convenience for combined behavior of |
LoadStates |
|
Public constructors |
|
---|---|
CombinedLoadStates( |
val append: LoadState
Convenience for combined behavior of APPEND
LoadState
, which generally defers to mediator
if it exists, but if previously was LoadState.Loading
, awaits for both source
and mediator
to become LoadState.NotLoading
to ensure the remote load was applied.
For use cases that require reacting to LoadState
of source
and mediator
specifically, e.g., showing cached data when network loads via mediator
fail, LoadStates
exposed via source
and mediator
should be used directly.
val mediator: LoadStates?
LoadStates
corresponding to loads from a RemoteMediator
, or null
if RemoteMediator
not present.
val prepend: LoadState
Convenience for combined behavior of PREPEND
LoadState
, which generally defers to mediator
if it exists, but if previously was LoadState.Loading
, awaits for both source
and mediator
to become LoadState.NotLoading
to ensure the remote load was applied.
For use cases that require reacting to LoadState
of source
and mediator
specifically, e.g., showing cached data when network loads via mediator
fail, LoadStates
exposed via source
and mediator
should be used directly.
val refresh: LoadState
Convenience for combined behavior of REFRESH
LoadState
, which generally defers to mediator
if it exists, but if previously was LoadState.Loading
, awaits for both source
and mediator
to become LoadState.NotLoading
to ensure the remote load was applied.
For use cases that require reacting to LoadState
of source
and mediator
specifically, e.g., showing cached data when network loads via mediator
fail, LoadStates
exposed via source
and mediator
should be used directly.
CombinedLoadStates(
refresh: LoadState,
prepend: LoadState,
append: LoadState,
source: LoadStates,
mediator: LoadStates? = null
)