Skip to content

Instantly share code, notes, and snippets.

@CodyEngel
Created April 15, 2017 00:13
Show Gist options
  • Save CodyEngel/37f366a984709f76bce3c9ee352b0f34 to your computer and use it in GitHub Desktop.
Save CodyEngel/37f366a984709f76bce3c9ee352b0f34 to your computer and use it in GitHub Desktop.
A companion Observer for DisposableManager.
public class DisposingObserver<T> implements Observer<T> {
@Override
@CallSuper
public void onSubscribe(Disposable d) {
DisposableManager.add(d);
}
@Override
public void onNext(T next) {}
@Override
public void onError(Throwable e) {}
@Override
public void onComplete() {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment