Last active
January 16, 2018 13:03
-
-
Save communikein/64261e5afcec4b52d6e47f3c9063fa2f 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
@Singleton | |
public class PoisRepository { | |
private final WebService mWebService; | |
private final AppExecutors mExecutors; | |
private MutableLiveData<List<Poi>> mWebServerPois; | |
@Inject | |
public PoisRepository(WebService webService, AppExecutors executors) { | |
this.mWebService = webService; | |
mWebServerPois = new MutableLiveData<>(); | |
mWebService.getPois().enqueue((call, response) -> { | |
mWebServerPois.setValue(response.body()); | |
}); | |
} | |
public LiveData<List<Poi>> getObservableAllPois() { | |
return mWebServerPois; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment