Created
February 12, 2019 22:49
-
-
Save ramonrabello/8bc25288fb35fc911e14c8efd956c30d to your computer and use it in GitHub Desktop.
PeopleRepository using 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
tmdbApi.loadPeople() | |
.map { movie -> movie.urls } | |
.map { url -> tmdbApi.movieDetails(url) } | |
.subscribeOn(Schedulers.io()) | |
.observeOn(AndroidSchedulers.mainThread()) | |
.subscribe(onSuccess = { details -> view. showMovieDetails(details) }, | |
onError = { view. showErrorMessage() }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment