Created
April 7, 2024 04:44
-
-
Save LloydBlv/463c600cb882414f93359bbb5c2b42f8 to your computer and use it in GitHub Desktop.
Expose Immutable State
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 RatesViewModel constructor( | |
private val ratesRepository: RatesRepository, | |
) : ViewModel() { | |
private val _state = MutableStateFlow(RatesUiState(isLoading = true)) | |
val state: StateFlow<RatesUiState> | |
get() = _state.asStateFlow() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment