Skip to content

Commit

Permalink
chore: chain map + filterNotNull calls
Browse files Browse the repository at this point in the history
  • Loading branch information
outadoc committed Jun 30, 2024
1 parent 49de152 commit 33274e9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ import kotlinx.coroutines.flow.flowOn
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.mapLatest
import kotlinx.coroutines.flow.mapNotNull
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.flow.runningFold
import kotlinx.coroutines.flow.stateIn
Expand Down Expand Up @@ -271,7 +272,7 @@ internal class ChatViewModel(
.flatMapConcat { event ->
chatEventViewMapper.map(event).asFlow()
}
.map { event ->
.mapNotNull { event ->
when (event) {
is ChatListItem.Message -> {
Action.AddMessages(listOf(event))
Expand Down Expand Up @@ -327,7 +328,6 @@ internal class ChatViewModel(
}
}
}
.filterNotNull()
.onEach { action -> actions.emit(action) }
.launchIn(defaultScope)

Expand Down

0 comments on commit 33274e9

Please sign in to comment.