Last active
June 9, 2020 23:44
-
-
Save raulh82vlc/a7f884a8c2ef8f8af4772f1e299381e7 to your computer and use it in GitHub Desktop.
NetworkDataSourceImpl java version with Single - RxJava
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
@NotNull | |
Single<List<TweetApiModel>> search(@NotNull String token, @NotNull String query) { | |
return twitterApi.search(requestsIOHandler.getTokenFormatted(access.getToken()),query) | |
.subscribeOn(taskThreading.io()) | |
.observeOn(taskThreading.computation()) | |
.filter(requestsIOHandler::searchHasNoErrorResponse) | |
.map(requestsIOHandler::getSearchContent) | |
.map(requestsIOHandler::getTweets) | |
.flatMapSingle(Single::just)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment