Skip to content

Instantly share code, notes, and snippets.

@JoseAlcerreca
Created September 8, 2017 12:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JoseAlcerreca/4b17994cf7f5d64a61f27a2a9bdfb1fd to your computer and use it in GitHub Desktop.
Save JoseAlcerreca/4b17994cf7f5d64a61f27a2a9bdfb1fd to your computer and use it in GitHub Desktop.
LiveData<Repo> repo = Transformations.switchMap(repoIdLiveData, repoId -> {
if (repoId.isEmpty()) {
return AbsentLiveData.create();
}
return repository.loadRepo(repoId);
}
);
@EhsanMashhadi
Copy link

Should I use blank observe for this transformation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment