Created
May 7, 2018 16:51
-
-
Save zawadz88/9edc2e321a663741fe98ed00090ae3cb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| abstract class BaseReactiveUseCase(threadExecutor: ThreadExecutor, | |
| postExecutionThread: PostExecutionThread) { | |
| protected val threadExecutorScheduler: Scheduler = Schedulers.from(threadExecutor) | |
| protected val postExecutionThreadScheduler: Scheduler = postExecutionThread.scheduler | |
| private val disposables = CompositeDisposable() | |
| open fun dispose() { | |
| if (!disposables.isDisposed) { | |
| disposables.dispose() | |
| } | |
| } | |
| protected fun addDisposable(disposable: Disposable) { | |
| disposables.add(checkNotNull(disposable, { "disposable cannot be null!" })) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment