Skip to content

Instantly share code, notes, and snippets.

@communikein
Last active January 16, 2018 13:03
Show Gist options
  • Save communikein/64261e5afcec4b52d6e47f3c9063fa2f to your computer and use it in GitHub Desktop.
Save communikein/64261e5afcec4b52d6e47f3c9063fa2f to your computer and use it in GitHub Desktop.
@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