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()
}
Overview
Automatically call
dispose()
of theCompositeDisposable
depending on ViewModel's lifecycle.