Does this idea of screen state make sense? I want ...
# android
t
Does this idea of screen state make sense? I want to emit an empty screen state from viewmodel to ui and the screen state has a kotlin lambda inside of it for a call back when a button is clicked. E.g:
Copy code
data class (
    val message: String,
    val callback: () -> Unit
)
k
Yes it makes sense, I have similar approach in my apps and it works well Small tip: As I’m using a lot of
() -> Unit
types, I created a following alias to avoid writing the same over and over again:
Copy code
typealias Callback = () -> Unit
t
That’s great @KamilH . Thanks