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
KamilH
03/17/2020, 5:13 PM
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: