Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@k0siara
Last active July 25, 2021 12:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save k0siara/1e611f2842c6a0a8f5ce1e79e2d0f8d6 to your computer and use it in GitHub Desktop.
Save k0siara/1e611f2842c6a0a8f5ce1e79e2d0f8d6 to your computer and use it in GitHub Desktop.
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