0.7.0
Update dependencies
- AndroidX Lifecycle
2.7.0
. - Android target: update
Compile SDK
andTarget SDK
to34
. - KotlinX Coroutines
1.8.0
.
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
'saddCloseable()
now immediately closes theCloseable
if theViewModel
has been cleared.
This behavior is the same across all targets ✅.
kmp-viewmodel-koin
-
Fixed:
koinViewModelFactory
:CreationExtras
passed toViewModelFactory.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),
andkmp-viewmodel-koin-compose
(common & jvm).