CombinedLoadStates



Collection of pagination LoadStates for both a PagingSource, and RemoteMediator.

Note: The REFRESHLoadType.REFRESH always has LoadState.endOfPaginationReached set to false.

Summary

Public constructors

CombinedLoadStates(
    refresh: LoadState,
    prepend: LoadState,
    append: LoadState,
    source: LoadStates,
    mediator: LoadStates?
)
Cmn

Public functions

open operator Boolean
equals(other: Any?)
Cmn
open Int
Cmn
open String
Cmn

Public properties

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.

Cmn
Boolean

Returns true if either source or mediator has a LoadType that is in LoadState.Error

Cmn
Boolean

Returns true when source and mediator is in NotLoading for all LoadType

Cmn
LoadStates?

LoadStates corresponding to loads from a RemoteMediator, or null if RemoteMediator not present.

Cmn
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.

Cmn
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.

Cmn
LoadStates

LoadStates corresponding to loads from a PagingSource.

Cmn

Public constructors

CombinedLoadStates

CombinedLoadStates(
    refresh: LoadState,
    prepend: LoadState,
    append: LoadState,
    source: LoadStates,
    mediator: LoadStates? = null
)

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

append

val appendLoadState

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.

hasError

val hasErrorBoolean

Returns true if either source or mediator has a LoadType that is in LoadState.Error

isIdle

val isIdleBoolean

Returns true when source and mediator is in NotLoading for all LoadType

mediator

val mediatorLoadStates?

LoadStates corresponding to loads from a RemoteMediator, or null if RemoteMediator not present.

prepend

val prependLoadState

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.

refresh

val refreshLoadState

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.

source

val sourceLoadStates

LoadStates corresponding to loads from a PagingSource.