Skip to content

Commit

Permalink
fixed viewmodel initialization issues on iOS, fixed illegal cast issu…
Browse files Browse the repository at this point in the history
…e on js target
  • Loading branch information
kkalisz committed Oct 8, 2024
1 parent 52fa48e commit 514c355
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ androidGradlePlugin = "8.6.1"
junit = "4.13.2"
junitJupiterEngine = "5.11.0"
junitJupiterApi = "5.11.0"
kotlin = "2.0.0"
kotlin = "2.0.20"
lifecycleRuntimeKtx = "2.8.6"
material = "1.7.2"
kotlinxCoroutinesCore = "1.9.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ private class ActionViewHolder<T> : ViewModel() {
private fun <E> rememberAction(
key: String? = null,
): Pair<Channel<E>, Flow<E>> {
return viewModel<ActionViewHolder<E>>(key = key).pair
return viewModel<ActionViewHolder<E>>(key = key){
ActionViewHolder()
}.pair
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ import kotlinx.coroutines.flow.map
*/
@Composable
fun rememberNavigator(key: String? = null): Navigator {
val viewModel = viewModel<NavigatorViewModel>(key = key)
val viewModel = viewModel<NavigatorViewModel>(key = key){
NavigatorViewModel()
}
return viewModel.navigator
}

Expand Down

0 comments on commit 514c355

Please sign in to comment.