Last active
November 5, 2018 19:44
-
-
Save hadilq/d927302e86f3bad148661d435d3113d9 to your computer and use it in GitHub Desktop.
This file contains 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 BaseViewModel : ViewModel() { | |
val actionStream = PublishSubject.create<Action>() | |
private val compositeDisposable: CompositeDisposable = CompositeDisposable() | |
protected fun Disposable.track() { | |
compositeDisposable.add(this) | |
} | |
override fun onCleared() { | |
compositeDisposable.clear() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment