Package me.aartikov.replica.decompose

Functions

Link copied to clipboard
fun Lifecycle.activeFlow(): StateFlow<Boolean>

Returns StateFlow of booleans that indicates if Lifecycle is active. Lifecycle is considered active when it is STARTED or RESUMED.

Link copied to clipboard
fun Lifecycle.coroutineScope(): CoroutineScope

Returns CoroutineScope that is tied to Lifecycle. The coroutine scope is canceled when Lifecycle is destroyed.

Link copied to clipboard
fun <T : Any> Replica<T>.observe(lifecycle: Lifecycle): ReplicaObserver<T>

Observes Replica in a a scope of Lifecycle.

fun <T : Any, K : Any> KeyedReplica<K, T>.observe(lifecycle: Lifecycle, key: StateFlow<K?>): ReplicaObserver<T>

Observes KeyedReplica in a scope of Lifecycle.