How to change the value of state object without using _?
In my app I perform a request to an API that should return a boolean. Inside the ViewModel class I have these 2 objects:
private val _isAvailableState = mutableStateOf(Success(false))
val isAvailableState: State = _isAvailableState
One is mutable and the other one isn't. Here is how I read the value:
fun checkAvailability() = viewModelScope.launch {
repository.checkAvailability().collect { response ->
_isAvailableState.value = response
}
}
Is there any way in which I can...