PagingLiveData

public final class PagingLiveData


Summary

Public fields

final @NonNull LiveData<@NonNull PagingData<@NonNull Value>>

A LiveData of PagingData, which mirrors the stream provided by Pager.flow, but exposes it as a LiveData.

Public constructors

Public methods

static final @NonNull LiveData<@NonNull PagingData<@NonNull T>>
<T extends Object> PagingLiveData.cachedIn(
    LiveData<PagingData<T>> receiver,
    Lifecycle lifecycle
)

Operator which caches a LiveData of PagingData within the scope of a Lifecycle.

static final @NonNull LiveData<@NonNull PagingData<@NonNull T>>
<T extends Object> PagingLiveData.cachedIn(
    LiveData<PagingData<T>> receiver,
    ViewModel viewModel
)

Operator which caches a LiveData of PagingData within the scope of a ViewModel.

static final @NonNull LiveData<@NonNull PagingData<@NonNull T>>
<T extends Object> PagingLiveData.cachedIn(
    LiveData<PagingData<T>> receiver,
    CoroutineScope scope
)

Operator which caches a LiveData of PagingData within a CoroutineScope.

Public fields

liveData

public final @NonNull LiveData<@NonNull PagingData<@NonNull Value>> liveData

A LiveData of PagingData, which mirrors the stream provided by Pager.flow, but exposes it as a LiveData.

NOTE: Instances of PagingData emitted by this LiveData are not re-usable and cannot be submitted multiple times. This is especially relevant because LiveData will replays the latest value downstream. To ensure you get a new instance of PagingData for each downstream observer, you should use the cachedIn operator which multicasts the LiveData in a way that returns a new instance of