Last active
June 29, 2017 20:07
-
-
Save rohans-doordash/2c59b83b8c777e1fc31c4d01f27a09ea to your computer and use it in GitHub Desktop.
Fetch restaurants with their Yelp rating and review count
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 Single<Pair<List<Restaurant>, Boolean>> getRestaurantList(int userId) { | |
Single<List<Restaurant>> restaurantListSingle = | |
ddApi.getUserInfo(userId).flatMap(user -> { | |
return ddApi.getAvailableRestaurant(user.defaultAddress.lat, user.defaultAddress.lng); | |
}); | |
Single<Boolean> showPhotoExperimentSingle = | |
ddApi.getShowPhotosExperiment(userId); | |
return restaurantListSingle.zipWith(showPhotoExperimentSingle, Pair::new); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment