Skip to content

Instantly share code, notes, and snippets.

@mattrob33
Last active March 9, 2022 14:57
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 mattrob33/2e85f363e29e0c3c8e1f971d8bbeed34 to your computer and use it in GitHub Desktop.
Save mattrob33/2e85f363e29e0c3c8e1f971d8bbeed34 to your computer and use it in GitHub Desktop.
val movie: LiveData<Movie> = ...
val title: LiveData<String> = Transformations.map(movie) { it.title }
val cast: LiveData<List<Actor>> = Transformations.switchMap(movie) { getCast(it) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment