Skip to content

Instantly share code, notes, and snippets.

@aaronjyoder
Last active November 11, 2021 17:04
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 aaronjyoder/5443f0da5765c1892fcbb199ff415737 to your computer and use it in GitHub Desktop.
Save aaronjyoder/5443f0da5765c1892fcbb199ff415737 to your computer and use it in GitHub Desktop.
class MyViewModel {
private val selectedRegions: MutableState<ArrayDeque<Point>> = mutableStateOf(ArrayDeque())
private val selectedTerritories: MutableState<MutableSet<Territory>> = mutableStateOf(HashSet())
fun isSelectingRegion: Boolean {
return selectedRegions.value.size > 0
}
fun isSelectingTerritory: Boolean {
return selectedTerritories.value.size > 0
}
// Other functions
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment