Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class ExampleViewModel(
private val initialState: ExampleViewState
) : ViewModel() {
private val _uiState: MutableStateFlow<ExampleViewState> = MutableStateFlow(initialState)
val uiState = _uiState.asStateFlow()
}
data class ExampleViewState(
val title: String = "",
val description: String = ""
// other state variables
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment