Last active
February 9, 2017 00:50
-
-
Save yemyatthu1990/036701e5b54bfe99355adea0d1b7868b 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 TownshipCloudDataStore implements TownshipDataStore { | |
private final TownshipCache townshipCache; | |
TownshipCloudDataStore(TownshipCache townshipCache){ | |
this.townshipCache = townshipCache; | |
} | |
@Override | |
public Observable<List<TownshipEntity>> townships() { | |
return ServiceGenerator.getTownshipService().getTownships().doOnNext(new Consumer<List<TownshipEntity>>() { | |
@Override | |
public void accept(final List<TownshipEntity> townshipEntities) throws Exception { | |
townshipCache.put(townshipEntities); | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment