Created
March 16, 2016 22:24
-
-
Save patrykpoborca/436647fa12fdd908f512 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
private Retrofit retrofit = ApplicationFactory.getRetrofitClient(); | |
private ManagerDelegate managerDelegate = ApplicationFactory.getManagerDelegateImpl(); | |
private Observable<Response> retrieveSomeValue(String param) { | |
RetrofitClient client = retrofit.create(RetrofitClient.class); | |
Observable<Response> request = client.doRequest(param); | |
request.subscribe(response ->{ | |
CachingManager.getInstance().cacheSimpleResponse(response); | |
// Which one's better? | |
managerDelegate.getCachingManager.cacheSimpleResponse(response); | |
}); | |
//by returning the "promise" of this network request we can allow some other component of the app to do the routing for us. | |
return request; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment