diff --git a/examples/todoapp/buildSrc/buildSrc/src/main/kotlin/Deps.kt b/examples/todoapp/buildSrc/buildSrc/src/main/kotlin/Deps.kt index e5dbb9af2e..9a06e3bd40 100644 --- a/examples/todoapp/buildSrc/buildSrc/src/main/kotlin/Deps.kt +++ b/examples/todoapp/buildSrc/buildSrc/src/main/kotlin/Deps.kt @@ -35,7 +35,7 @@ object Deps { } object Decompose { - private const val VERSION = "0.0.10" + private const val VERSION = "0.1.0" const val decompose = "com.arkivanov.decompose:decompose:$VERSION" } } diff --git a/examples/todoapp/common/utils/src/commonMain/kotlin/example/todo/common/utils/RouterStateComposable.kt b/examples/todoapp/common/utils/src/commonMain/kotlin/example/todo/common/utils/RouterStateComposable.kt index c3f890eb09..f323de4d93 100644 --- a/examples/todoapp/common/utils/src/commonMain/kotlin/example/todo/common/utils/RouterStateComposable.kt +++ b/examples/todoapp/common/utils/src/commonMain/kotlin/example/todo/common/utils/RouterStateComposable.kt @@ -19,7 +19,7 @@ private typealias SavedState = Map> @Composable fun Value>.children(render: @Composable() (child: T, configuration: C) -> Unit) { val parentRegistry: UiSavedStateRegistry? = UiSavedStateRegistryAmbient.current - val children = remember { Children() } + val children = remember(value) { Children() } if (parentRegistry != null) { onDispose { @@ -32,7 +32,7 @@ fun Value>.children(render: @Composa } } - invoke { state -> + observe { state -> val activeChildConfiguration = state.activeChild.configuration val currentChild: ActiveChild? = children.active diff --git a/examples/todoapp/common/utils/src/commonMain/kotlin/example/todo/common/utils/ValueComposable.kt b/examples/todoapp/common/utils/src/commonMain/kotlin/example/todo/common/utils/ValueComposable.kt index ac4d51257f..528831c193 100644 --- a/examples/todoapp/common/utils/src/commonMain/kotlin/example/todo/common/utils/ValueComposable.kt +++ b/examples/todoapp/common/utils/src/commonMain/kotlin/example/todo/common/utils/ValueComposable.kt @@ -29,6 +29,6 @@ fun Value.asState(): State { } @Composable -operator fun Value.invoke(render: @Composable() (T) -> Unit) { - render(asState().value) +fun Value.observe(observer: @Composable() (T) -> Unit) { + observer(asState().value) }