Last active
May 9, 2017 18:25
-
-
Save ZherebtsovAlexandr/48d0bd682c7b1b7dab85551131befc76 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 class SearchPlaceInteractorImpl extends SearchOffsetLimitIneractor { | |
private final PlaceDataProvider placeDataProvider; | |
public SearchPlaceInteractorImpl(ThreadExecutor threadExecutor, | |
PostExecutionThread postExecutionThread, | |
PlaceDataProvider placeDataProvider) { | |
super(threadExecutor, postExecutionThread); | |
this.placeDataProvider = placeDataProvider; | |
} | |
@Override | |
protected Observable buildUseCaseObservable() { | |
return Observable.zip(queryObservable, offsetObservable, (query, offset) -> | |
placeDataProvider.getPlacesRemote(query, offset, LIMIT) | |
.map(places -> toIds(places)) | |
.flatMap(ids -> placeDataProvider.getPlacesByIdsLocal(ids))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment