Skip to content

Instantly share code, notes, and snippets.

@TorkelV
Last active October 20, 2020 22:07
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 TorkelV/edb4338e2d2f0343aebd328e1d402f35 to your computer and use it in GitHub Desktop.
Save TorkelV/edb4338e2d2f0343aebd328e1d402f35 to your computer and use it in GitHub Desktop.
val activeGroup = prefs.activeGroup.asLiveData(viewModelScope.coroutineContext)
val phrases: LiveData<List<Phrase>> = activeGroup.switchMap { group ->
db.getAll(group)
.asLiveData(viewModelScope.coroutineContext)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment