daily pastebin goal
77%
SHARE
TWEET

Untitled

a guest Jan 20th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package id.ihwan.aac.network
  2.  
  3. import io.reactivex.Observer
  4. import io.reactivex.disposables.CompositeDisposable
  5. import io.reactivex.disposables.Disposable
  6.  
  7. abstract class ApiObserver<T> constructor(private val compositeDisposable: CompositeDisposable): Observer<T> {
  8.     override fun onComplete() {
  9.  
  10.     }
  11.  
  12.     override fun onSubscribe(d: Disposable) {
  13.         compositeDisposable.add(d)
  14.     }
  15.  
  16.     override fun onNext(t: T) {
  17.         onApiSuccess(t)
  18.     }
  19.  
  20.     override fun onError(e: Throwable) {
  21.         onApiError(e)
  22.     }
  23.  
  24.     abstract fun onApiSuccess(data: T)
  25.     abstract fun onApiError(er: Throwable)
  26. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top