Should be great if I could remove the box there as we do with states
Copy code
LaunchedEffect(Unit) {
val event by events.collectAsEvent()
when (event) {
...
}
}
k
kevin.cianfarini
02/12/2023, 2:39 PM
I might be misunderstanding your question, but it seems that your events flow is transient. I don't know why you'd want to collect events as state which is sticky.
j
Javier
02/12/2023, 2:47 PM
I don't want to collect them as State, I want to be able to have the same syntax but for event (
collectAsEvent
)
Something so is what I mean
Copy code
// events is `Flow<Event>`
LaunchedEffect(Unit) {
val eventEffect: Effect<Event> = events.collectAsEffect()
val event: Event by events.collectAsEffect()
when (event) {
...
}
}