Created
April 23, 2017 11:00
-
-
Save Laimiux/697ec2f9c60376afd00bb47593346e85 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
class StoreRepository { | |
Observable<Lce<List<Store>> getStoreEventStream() { | |
return userBundleManager.switchMap { bundleEvent -> | |
if (bundleEvent.isLoading()) { | |
return Observable.just(Lce.loading()) | |
} else if (bundleEvent.hasError()) { | |
return Observable.just(Lce.error(bundleEvent.getError())) | |
} else { | |
// Stores can come from cached source or network | |
return storeListEventStream(bundleEvent.data.getZipCode()) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment