Removes emit method from DataSource

This commit is contained in:
ericdecanini 2022-06-03 14:53:26 +02:00
parent a5fd11c204
commit d586f64338

View File

@ -26,8 +26,6 @@ interface DataSource<T> {
interface MutableDataSource<T> : DataSource<T> {
suspend fun emit(value: T)
fun post(value: T)
}
@ -45,10 +43,6 @@ open class BehaviorDataSource<T>(private val defaultValue: T? = null) : MutableD
return mutableFlow
}
override suspend fun emit(value: T) {
mutableFlow.emit(value)
}
override fun post(value: T) {
mutableFlow.tryEmit(value)
}
@ -67,10 +61,6 @@ open class PublishDataSource<T>(bufferSize: Int = 10) : MutableDataSource<T> {
return mutableFlow
}
override suspend fun emit(value: T) {
mutableFlow.emit(value)
}
override fun post(value: T) {
mutableFlow.tryEmit(value)
}