Skip to content

0.7.0

Compare
Choose a tag to compare
@github-actions github-actions released this 17 Feb 06:35
· 173 commits to master since this release

Update dependencies

kmp-viewmodel and kmp-viewmodel-savedstate

  • New: Add support for Kotlin/Wasm (wasmJs target) 🎉.
  • The behavior of ViewModel.addCloseable(Closeable) on non-Android targets has been changed to be consistent with Android target.
    ViewModel's addCloseable() now immediately closes the Closeable if the ViewModel has been cleared.
    This behavior is the same across all targets ✅.

kmp-viewmodel-koin

  • Fixed: koinViewModelFactory: CreationExtras passed to ViewModelFactory.create will now be
    passed to the constructor of the ViewModel if it's requested.

    class MyViewModel(val extras: CreationExtras) : ViewModel()
    val myModule: Module = module {
      factoryOf(::MyViewModel)
    }
    
    val factory = koinViewModelFactory<MyViewModel>(
      scope = KoinPlatformTools.defaultContext().get().scopeRegistry.rootScope,
    )
    val extras = buildCreationExtras { /* ... */ }
    
    val viewModel: MyViewModel = factory.create(extras)
    viewModel.extras === extras // true <--- `viewModel.extras` is the same as `extras` passed to `factory.create(extras)`

Example, docs and tests

  • Add more tests to kmp-viewmodel-compose (android & jvm), kmp-viewmodel-koin (common),
    and kmp-viewmodel-koin-compose (common & jvm).