Skip to content

Commit

Permalink
Remove unneeded code and adjust the code format to be consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
ShreckYe committed Jan 7, 2025
1 parent c547df5 commit c005afb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ actual fun <VM : ViewModel> viewModel(

@Composable
actual inline fun <reified VM : ViewModel> viewModel(
viewModelStoreOwner: ViewModelStoreOwner, key: String?, noinline initializer: CreationExtras.() -> VM
viewModelStoreOwner: ViewModelStoreOwner,
key: String?,
noinline initializer: CreationExtras.() -> VM
): VM =
composeUiViewModel(viewModelStoreOwner, key, initializer)
9 changes: 0 additions & 9 deletions lifecycle-viewmodel/src/jsMain/kotlin/ViewModel.js.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,6 @@ actual inline fun <reified VM : ViewModel> viewModel(
viewModelStoreOwner.defaultCreationExtras()
)

// TODO remove
/*
@Composable
actual inline fun <reified VM : ViewModel> viewModel(
viewModelStoreOwner: ViewModelStoreOwner, key: String?, noinline initializer: CreationExtras.() -> VM
): VM =
remember(key) { CreationExtras.Empty.initializer() }
*/

internal fun <VM : ViewModel> ViewModelStoreOwner.get(
modelClass: KClass<VM>,
key: String?,
Expand Down

0 comments on commit c005afb

Please sign in to comment.