From c005afb24646753d29b989c3d34c3f18834e6170 Mon Sep 17 00:00:00 2001 From: Yongshun Shreck Ye Date: Tue, 7 Jan 2025 09:33:53 +0800 Subject: [PATCH] Remove unneeded code and adjust the code format to be consistent --- .../src/composeUiMain/kotlin/ViewModel.composeUi.kt | 4 +++- lifecycle-viewmodel/src/jsMain/kotlin/ViewModel.js.kt | 9 --------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/lifecycle-viewmodel/src/composeUiMain/kotlin/ViewModel.composeUi.kt b/lifecycle-viewmodel/src/composeUiMain/kotlin/ViewModel.composeUi.kt index 8bf5f49..8dd26b5 100644 --- a/lifecycle-viewmodel/src/composeUiMain/kotlin/ViewModel.composeUi.kt +++ b/lifecycle-viewmodel/src/composeUiMain/kotlin/ViewModel.composeUi.kt @@ -29,6 +29,8 @@ actual fun viewModel( @Composable actual inline fun viewModel( - viewModelStoreOwner: ViewModelStoreOwner, key: String?, noinline initializer: CreationExtras.() -> VM + viewModelStoreOwner: ViewModelStoreOwner, + key: String?, + noinline initializer: CreationExtras.() -> VM ): VM = composeUiViewModel(viewModelStoreOwner, key, initializer) diff --git a/lifecycle-viewmodel/src/jsMain/kotlin/ViewModel.js.kt b/lifecycle-viewmodel/src/jsMain/kotlin/ViewModel.js.kt index 1f372f5..a7bd921 100644 --- a/lifecycle-viewmodel/src/jsMain/kotlin/ViewModel.js.kt +++ b/lifecycle-viewmodel/src/jsMain/kotlin/ViewModel.js.kt @@ -44,15 +44,6 @@ actual inline fun viewModel( viewModelStoreOwner.defaultCreationExtras() ) -// TODO remove -/* -@Composable -actual inline fun viewModel( - viewModelStoreOwner: ViewModelStoreOwner, key: String?, noinline initializer: CreationExtras.() -> VM -): VM = - remember(key) { CreationExtras.Empty.initializer() } -*/ - internal fun ViewModelStoreOwner.get( modelClass: KClass, key: String?,