Skip to content

Instantly share code, notes, and snippets.

@cohenItay
Last active July 18, 2022 18:44
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 cohenItay/f1f896694afeae598d2ebebcb04b3fdc to your computer and use it in GitHub Desktop.
Save cohenItay/f1f896694afeae598d2ebebcb04b3fdc to your computer and use it in GitHub Desktop.
data class DataWithState(
val isLoading: Boolean = false
val myError: MyErrorModel? = null
val myConcreteData: MyConcerteDataModel = null
)
class MyViewModel(...) {
...
val myData: StateFlow<DataWithState> = MutableStateFlow()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment