Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
kkalisz committed Oct 8, 2024
1 parent 52fa48e commit 514c355
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
@@ -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"
Original file line number Diff line number Diff line change
@@ -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
}

/**
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 514c355

Please sign in to comment.