Skip to content

Instantly share code, notes, and snippets.

@AkshayMoorthy
Last active May 9, 2018 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AkshayMoorthy/64dfc8411c22ceae3dbe520a0d14b88b to your computer and use it in GitHub Desktop.
Save AkshayMoorthy/64dfc8411c22ceae3dbe520a0d14b88b to your computer and use it in GitHub Desktop.
Flowable<String> f = Flowable.just("Hello");
Disposable d1 = f.subscribeWith(new DisposableSubscriber<String>() { … });
Observable<String> o = Observable.just("Hello");
Disposable d2 = o.subscribeWith(new DisposableObserver<String>() { … });
Maybe<String> m = Maybe.just("Hello");
Disposable d3 = m.subscribeWith(new DisposableMaybeObserver<String>() { … });
Single<String> s = Single.just("Hello");
Disposable d4 = s.subscribeWith(new DisposableSingleObserver<String>() { … });
Completable c = Completable.completed();
Disposable d5 = c.subscribeWith(new DisposableCompletableObserver<String>() { … });
CompositeDisposable a=new CompositeDisposable();
a.add(o.subscribeWith(new DisposableObserver<String>() {…});
a.add(f.subscribeWith(new DisposableSubscriber<String>() {…});
@Override
protected void onDestroy() {
super.onDestroy();
d.dispose();
s.clear();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment