Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saqib-github-commits/616b0c177bf02394b2e843145038280d to your computer and use it in GitHub Desktop.
Save saqib-github-commits/616b0c177bf02394b2e843145038280d to your computer and use it in GitHub Desktop.
class LaunchedEffectNetworkStateViewModel: ViewModel() {
private var _networkUnavailable = MutableStateFlow(false)
val networkUnavailable get() = _networkUnavailable.asStateFlow()
init {
viewModelScope.launch {
delay(2000L)
_networkUnavailable.value = true
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment