Johann Pardanaud
01/12/2023, 9:59 AMonClick
parameter for the Button
class.
My feeling here is there is no idiomatic way to handle events, am I wrong?Chris Fillmore
01/12/2023, 11:42 AMJohann Pardanaud
01/12/2023, 12:03 PMDenys Kravchenko
01/12/2023, 12:14 PMVladimir Vainer
01/12/2023, 12:43 PMJohann Pardanaud
01/12/2023, 12:44 PMinterface SomeInterface {
val onSomeEvent: Flow<Unit>
}
And subscribe to it with collect?
val someInstance: SomeInterface
someInstance.onSomeEvent.collect { println("Event received!") }
Vladimir Vainer
01/12/2023, 12:44 PMsealed class AppEvent() {
object EventWithoutData: AppEvent()
data class EventWithData(val name: String) : AppEvent()
}
Vladimir Vainer
01/12/2023, 12:45 PMeventFlow = MutableSharedFlow<AppEvent>()
Johann Pardanaud
01/12/2023, 12:50 PM