Fix network state observer
This commit is contained in:
@@ -5,14 +5,11 @@ import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import java.util.concurrent.atomic.AtomicInteger
|
||||
|
||||
abstract class MediatorStateFlow<T> : StateFlow<T> {
|
||||
abstract class MediatorStateFlow<T>(initialValue: T) : StateFlow<T> {
|
||||
|
||||
@Suppress("LeakingThis")
|
||||
private val delegate = MutableStateFlow(initialValue)
|
||||
private val collectors = AtomicInteger(0)
|
||||
|
||||
protected abstract val initialValue: T
|
||||
|
||||
final override val replayCache: List<T>
|
||||
get() = delegate.replayCache
|
||||
|
||||
|
||||
Reference in New Issue
Block a user