ReplicaObserver

interface ReplicaObserver<out T : Any>

Replica observer connects to a replica and receives updates: state and loading error events. Replica observer can be active or inactive (this property is not exposed in the API but is used internally). Only active observer receives updates. Replica observer is associated with some User Interface - a screen or a part of screen.

Functions

Link copied to clipboard
abstract fun cancelObserving()

Cancels observing manually. Typically, the call of this method is not required, because an observer is tied to some coroutine scope.

Properties

Link copied to clipboard
abstract val loadingErrorFlow: Flow<LoadingError>

Flow of loading error events.

Link copied to clipboard
abstract val stateFlow: StateFlow<Loadable<T>>

Flow of replica states.

Extensions

Link copied to clipboard
val <T : Any> ReplicaObserver<T>.currentState: Loadable<T>

Returns current replica state.