Created
May 1, 2023 20:10
-
-
Save saqib-github-commits/616b0c177bf02394b2e843145038280d to your computer and use it in GitHub Desktop.
This file contains 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
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