Created
April 12, 2017 15:56
-
-
Save kmshack/cb7357a0ad29810c2d9a11d78fb29507 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
public Observable<Post> loadTodayPosts() { | |
return mRetrofitService.loadPosts() | |
.concatMap(new Func1<List<Post>, Observable<Post>>() { | |
@Override | |
public Observable<Post> call(List<Post> apiPosts) { | |
return mDatabaseHelper.savePosts(apiPosts); | |
} | |
}) | |
.filter(new Func1<Post, Boolean>() { | |
@Override | |
public Boolean call(Post post) { | |
return isToday(post.date); | |
} | |
}); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment