Last active
January 24, 2018 07:12
-
-
Save khunzohn/264a317521ea5d106ac3415cf846b778 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 void getUser(String userId) { | |
getView().showLoading(“fetching user…”); | |
Subscription sub = userRepository.getUser(userId) | |
.subscribeOn(Schedulers.io()) | |
.observeOn(AndroidScheduler.mainThread()) | |
.subscribe(user -> { | |
getView().stopLoading(); | |
getView().render(user); | |
},e->{ | |
getView.stopLoading(); | |
getView().renderError(e); | |
}) | |
compositeSubscription.add(subscription); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment