observe
abstract fun observe(observerCoroutineScope: CoroutineScope, observerActive: StateFlow<Boolean>): ReplicaObserver<T>
Content copied to clipboard
Starts to observe a replica. Returned ReplicaObserver gives access to replica state and error events.
Parameters
observerCoroutineScope
represents life time of an observer. An observer will stop observing when observerCoroutineScope is canceled.
observerActive
a StateFlow of observer states (active or inactive). Allows replica to know if it has active observers.