Dmytro Danylyk
03/30/2018, 10:55 AMvuserChannel
.filterNotNull()
.map(CommonPool) { it.userName }
.consumeEach(UI) { user_name.text = it }
elizarov
03/30/2018, 11:40 AMalucard
03/30/2018, 11:42 PMDmytro Danylyk
03/31/2018, 9:07 AMView
and ViewModel
.
2. ViewModel
have userChannel
which emits User
whenever it changes.
3. View
consume all events from userChannel
. Because map
is heavy
operation I wan’t to execute it on non-ui thread, after that I want to consume all events on ui-thread because I touch views.launch(UI) {
userChannel.map(CommonPool) { it.userName }
.consumeEach { user_name.text = it }
}
I would like to avoid those braces.