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

View file

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