Changes set method name to emit

This commit is contained in:
ericdecanini 2022-05-26 15:45:18 +02:00
parent b0ce32e97e
commit e84f012b73
2 changed files with 5 additions and 5 deletions

View file

@ -26,7 +26,7 @@ interface DataSource<T> {
interface MutableDataSource<T> : DataSource<T> {
suspend fun set(value: T)
suspend fun emit(value: T)
fun post(value: T)
}
@ -45,7 +45,7 @@ open class BehaviorDataSource<T>(private val defaultValue: T? = null) : MutableD
return mutableFlow
}
override suspend fun set(value: T) {
override suspend fun emit(value: T) {
mutableFlow.emit(value)
}
@ -65,7 +65,7 @@ open class PublishDataSource<T> : MutableDataSource<T> {
return mutableFlow
}
override suspend fun set(value: T) {
override suspend fun emit(value: T) {
mutableFlow.emit(value)
}

View file

@ -473,13 +473,13 @@ class MessageComposerViewModel @AssistedInject constructor(
}
is ParsedCommand.UpgradeRoom -> {
viewModelScope.launch {
_viewEvents.set(
_viewEvents.emit(
MessageComposerViewEvents.ShowRoomUpgradeDialog(
parsedCommand.newVersion,
room.roomSummary()?.isPublic ?: false
)
)
_viewEvents.set(MessageComposerViewEvents.SlashCommandResultOk(parsedCommand))
_viewEvents.emit(MessageComposerViewEvents.SlashCommandResultOk(parsedCommand))
popDraft()
}
}