Skip to content

0.5.0

Compare
Choose a tag to compare
@github-actions github-actions released this 27 Sep 09:56
· 316 commits to master since this release

Update dependencies

  • Kotlin 1.9.0.
  • AndroidX Lifecycle 2.6.1.
  • KotlinX Coroutines 1.7.3.
  • Android Gradle Plugin 8.1.0.

viewmodel

  • Add ViewModelStore and ViewModelStoreOwner.
  • Add ViewModelFactory and VIEW_MODEL_KEY.
  • Add CreationExtras and CreationExtrasKey.
  • Add buildCreationExtras and CreationExtras.edit.
  • Add ViewModel.isCleared() method to check if the ViewModel is cleared, only available on
    non-Android targets
    .
  • Add MainThread (moved from viewmodel-savedstate module).

viewmodel-savedstate

  • Remove MainThread (moved to viewmodel module).
  • Add SavedStateHandleFactory interface.
  • Add SAVED_STATE_HANDLE_FACTORY_KEY and CreationExtras.createSavedStateHandle().

viewmodel-compose

  • A new module allows to access ViewModels in Jetpack Compose Multiplatform.

    • kmpViewModel to retrieve ViewModels in @composable functions.
    • LocalSavedStateHandleFactory and SavedStateHandleFactoryProvider to
      get/provide SavedStateHandleFactory in @composable functions.
      It allows integration with any navigation library.
    • LocalViewModelStoreOwner and ViewModelStoreOwnerProvider to
      get/provide ViewModelStoreOwner in @composable functions.
      It allows integration with any navigation library.
    • defaultPlatformCreationExtras and defaultPlatformViewModelStoreOwner
      to get the default CreationExtras and ViewModelStoreOwner,
      which depends on the platform.
  • Dependencies: Compose Multiplatform 1.5.0.

  • Docs: 0.x Viewmodel-Compose docs.

Example, docs and tests