skydoves / viewmodel-lifecycle

🌳 ViewModel Lifecycle allows you to track and observe Jetpack's ViewModel lifecycle changes.
Apache License 2.0
105 stars 10 forks source link

TODO: RxJava/RxKotlin supports #2

Closed skydoves closed 2 years ago

skydoves commented 2 years ago

Overview

Automatically call dispose() of the CompositeDisposable depending on ViewModel's lifecycle.


class MyViewModel: ViewModel() {
  // This will be automatically disposed of when ViewModel will be cleared.
  prival val compositeDisposable = AutoDisposeCompositeDisposable()
}