Skip to content

Instantly share code, notes, and snippets.

@suzukieng
Last active December 10, 2021 13:08
Show Gist options
  • Save suzukieng/428e1aa01376f46652b1d8364eb14a1c to your computer and use it in GitHub Desktop.
Save suzukieng/428e1aa01376f46652b1d8364eb14a1c to your computer and use it in GitHub Desktop.
StateUpdate.kt
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