Created
December 22, 2021 15:26
-
-
Save fergusonm/5ef6d0793d9419b2a3f6ff9d048a871e to your computer and use it in GitHub Desktop.
View model UI stateflow
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 MyViewMode: ViewModel() { | |
data class ViewState( | |
val someUIProperty: String = "", | |
val someOtherUIProperty: Int = 1, | |
) | |
private val _viewState = MutableStateFlow<ViewState>(ViewState()) | |
val viewState = _viewState.asStateFlow() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment