Skip to content

1.0.3

Choose a tag to compare

@skydoves skydoves released this 31 Jan 06:36
· 13 commits to main since this release
a7c4513

🎉 A new version 1.0.3 has been released! 🎉

Introduce

Now Lazybones supports lifecycleAware for Jetpack ViewModel to track and observe the lifecycle changes of the ViewModel. Basically, Lazybones-ViewModel allows you to observe two lifecycle changes: Initialize and Clear.

class MyViewModel : ViewModel() {

  private val lifecycleAwareCompositeDisposable = lifecycleAware { CompositeDisposable() }
    .onInitialize {
      Log.d(TAG, "ViewModel is initialized")
    }.onClear {
      Log.d(TAG, "ViewModel is cleared")
      dispose() // dispose CompositeDisposable when viewModel is getting cleared
    }
}

What's Changed

Full Changelog: 1.0.2...1.0.3