mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Remove SharedFlowHolder
This commit is contained in:
-14
@@ -1,14 +0,0 @@
|
|||||||
package io.element.android.x.architecture
|
|
||||||
|
|
||||||
import kotlinx.coroutines.flow.MutableSharedFlow
|
|
||||||
import kotlinx.coroutines.flow.asSharedFlow
|
|
||||||
|
|
||||||
class SharedFlowHolder<Data>(capacity: Int = 64) {
|
|
||||||
private val mutableFlow: MutableSharedFlow<Data> = MutableSharedFlow(extraBufferCapacity = capacity)
|
|
||||||
|
|
||||||
fun asSharedFlow() = mutableFlow.asSharedFlow()
|
|
||||||
|
|
||||||
fun emit(data: Data) = mutableFlow.tryEmit(data)
|
|
||||||
|
|
||||||
suspend fun awaitEmit(data: Data) = mutableFlow.emit(data)
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user