Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Wrapping with transformers
private CompositeSubscription subscriptions = new CompositeSubscription();
public <T> Observable<T> subscribe(Observable<T> observable) {
subscriptions.add(observable.subscribe());
return observable;
}
public <T> Observable.Transformer<T, T> subscribeTransformer() {
return new Observable.Transformer<T, T>() {
@Override
public Observable<T> call(Observable<T> observable) {
return subscribe(observable);
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.