I\'m in search for a better way to achieve a simple Observable fallback system for empty results when using RxJava. The idea is that, if a local query for a set of data results
After some research and looking at other peoples responses, I believe using a Transformer is the most robust solution, like so...
Observable.from(Collections.emptyList()) .compose(new Observable.Transformer, List>() { @Override public Observable call(Observable> source) { boolean isEmpty = observable.isEmpty().toBlocking().first(); if (isEmpty) { return backupObservable(); } else { return source; } } });