Removes emit method from DataSource
This commit is contained in:
parent
a5fd11c204
commit
d586f64338
@ -26,8 +26,6 @@ interface DataSource<T> {
|
|||||||
|
|
||||||
interface MutableDataSource<T> : DataSource<T> {
|
interface MutableDataSource<T> : DataSource<T> {
|
||||||
|
|
||||||
suspend fun emit(value: T)
|
|
||||||
|
|
||||||
fun post(value: T)
|
fun post(value: T)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,10 +43,6 @@ open class BehaviorDataSource<T>(private val defaultValue: T? = null) : MutableD
|
|||||||
return mutableFlow
|
return mutableFlow
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun emit(value: T) {
|
|
||||||
mutableFlow.emit(value)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun post(value: T) {
|
override fun post(value: T) {
|
||||||
mutableFlow.tryEmit(value)
|
mutableFlow.tryEmit(value)
|
||||||
}
|
}
|
||||||
@ -67,10 +61,6 @@ open class PublishDataSource<T>(bufferSize: Int = 10) : MutableDataSource<T> {
|
|||||||
return mutableFlow
|
return mutableFlow
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun emit(value: T) {
|
|
||||||
mutableFlow.emit(value)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun post(value: T) {
|
override fun post(value: T) {
|
||||||
mutableFlow.tryEmit(value)
|
mutableFlow.tryEmit(value)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user