https://kotlinlang.org logo
Title
a

Adam Brown

05/10/2023, 12:35 AM
hey how are people handling one time events, like Toast/Snackbar events that the UI need to listen to and dispatch once?
I was thinking about consuming a Flow in compose using
collectAsStateWithLifecycle
but am not sure how that'll work on iOS
that didnt work well, but a
String?
on the state that uses a
LaunchedEffect
in compose works well
a

Arkadii Ivanov

05/10/2023, 6:57 AM
One of the options - expose some sort of CFlow (a Swift friendly wrapper class). Another option - have errors part of the state, and clear when handled in the UI.
a

Adam Brown

05/11/2023, 11:11 PM
okay ya the 2nd option is working for me for now