Skip to content

Commit

Permalink
Merge pull request #390 from kkalisz/bugfix/compose-viewmodel
Browse files Browse the repository at this point in the history
[iOS][WASM] fixes for compose-1.7
  • Loading branch information
Tlaster authored Oct 9, 2024
2 parents 52fa48e + 3d69a95 commit 37e9089
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 37e9089

Please sign in to comment.