You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using kotlinx.coroutines version 1.1.1, and Kotlin 1.3.20.
I'm using a ConflatedBroadcastChannel to send View events in Android (from the main thread) to the presenter that that receives them (also on the main thread).
The documentation for ConflatedBroadcastChannel says:
only the the most recently sent value is received, while previously sent elements are lost.
In this case, the reverse is actually true. The most recent value is lost, while previously sent values make it through.
Relevant View code:
val broadcastChannel:BroadcastChannel<AuthEmailEvent> =ConflatedBroadcastChannel()
val selectedCredential = state.previousCredentials[position]
broadcastChannel.offer(AuthEmailEvent.EmailUpdate(selectedCredential.first))
broadcastChannel.offer(AuthEmailEvent.PasswordUpdate(selectedCredential.second))
for (event in view.events()) {
when (event) {
isAuthEmailEvent.EmailUpdate-> state = state.copy(
email = event.email,
isEmailValid =!event.email.isBlank()
)
isAuthEmailEvent.PasswordUpdate-> state = state.copy(
password = event.password,
isPasswordValid =!event.password.isBlank()
)
}
}
The first event, AuthEmailEvent.EmailUpdate is received and processed, but the AuthEmailEvent.PasswordUpdate, which is the most recent event is lost, and never received.
The text was updated successfully, but these errors were encountered:
I'm using kotlinx.coroutines version 1.1.1, and Kotlin 1.3.20.
I'm using a
ConflatedBroadcastChannel
to sendView
events in Android (from the main thread) to the presenter that that receives them (also on the main thread).The documentation for
ConflatedBroadcastChannel
says:In this case, the reverse is actually true. The most recent value is lost, while previously sent values make it through.
Relevant
View
code:Relevant
Presenter
code:The first event,
AuthEmailEvent.EmailUpdate
is received and processed, but theAuthEmailEvent.PasswordUpdate
, which is the most recent event is lost, and never received.The text was updated successfully, but these errors were encountered: