skydoves / viewmodel-lifecycle

🌳 ViewModel Lifecycle allows you to track and observe Jetpack's ViewModel lifecycle changes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TODO: RxJava/RxKotlin supports

skydoves opened this issue · comments

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()
}