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 static class TestRx { | |
public void test(){ | |
Observable<String> getCacheHttpResource = Observable.from(new String[]{"Resource 1", "Resource 2 stale", "Resource 3"}); | |
getCacheHttpResource.flatMap(new Func1<String, Observable<String>>() { | |
@Override public Observable<String> call(String s) { | |
return Observable.merge(deserialize(s), filter(s).flatMap(new Func1<String, Observable<? extends String>>() { | |
@Override public Observable<? extends String> call(String s) { | |
return refreshFromNetwork(s); |
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
@Singleton | |
public class Controller { | |
private final Bus mBus; | |
private boolean mIsRefreshing; | |
private Exception mLastRefreshException; | |
@Inject | |
public Controller(Bus bus) { |