Last active
December 10, 2021 13:08
-
-
Save suzukieng/428e1aa01376f46652b1d8364eb14a1c to your computer and use it in GitHub Desktop.
StateUpdate.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private val uiState = mutableStateOf(UiState(/* initial state */)) | |
// ... | |
override fun connectionLost(cause: Throwable?) { | |
uiState.value = uiState.value.copy( | |
statusMessage = "Connection lost", | |
connected = false | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment