Created
October 20, 2016 18:27
-
-
Save michaelzengke/00b858a66580a0c9f42b74626a8a68cb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Observable<MyStuff> myStuffRepository = Observable | |
.merge(savedJobPostingRepository.onErrorReturn(error -> null), | |
appliedJobPostingRepository.retry(1)) | |
.reduce(new MyStuff(), (accumulated, item) -> { | |
switch (item.getEntityType()) { | |
case SavedJobs: | |
accumulated.savedJobPostings = item; | |
break; | |
case AppliedJobs: | |
accumulated.appliedJobPostings = item; | |
break; | |
} | |
return accumulated; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment