Created
September 8, 2017 12:42
-
-
Save JoseAlcerreca/4b17994cf7f5d64a61f27a2a9bdfb1fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LiveData<Repo> repo = Transformations.switchMap(repoIdLiveData, repoId -> { | |
if (repoId.isEmpty()) { | |
return AbsentLiveData.create(); | |
} | |
return repository.loadRepo(repoId); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Should I use blank observe for this transformation?