From 713126ddeb32473f26507a915a69c88bfe342968 Mon Sep 17 00:00:00 2001 From: Arkadii Ivanov Date: Tue, 22 Oct 2024 23:31:30 +0100 Subject: [PATCH] Updated Essenty to 2.2.0 and Compose to 1.7.0 --- deps.versions.toml | 4 ++-- .../sample/shared/counters/counter/DefaultCounterComponent.kt | 4 ++-- .../sample/shared/customnavigation/DefaultKittenComponent.kt | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/deps.versions.toml b/deps.versions.toml index a301a723a..30e9ad448 100644 --- a/deps.versions.toml +++ b/deps.versions.toml @@ -2,10 +2,10 @@ decompose = "3.2.0-beta03" kotlin = "2.0.20" -essenty = "2.2.0-beta01" +essenty = "2.2.0" reaktive = "1.2.3" junit = "4.13.2" -jetbrainsCompose = "1.7.0-rc01" +jetbrainsCompose = "1.7.0" jetbrainsKotlinWrappers = "1.0.0-pre.608" jetbrainsKotlinxCoroutines = "1.8.1" jetbrainsKotlinxSerialization = "1.6.3" diff --git a/sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/counters/counter/DefaultCounterComponent.kt b/sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/counters/counter/DefaultCounterComponent.kt index b19067e87..a0ad6c402 100644 --- a/sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/counters/counter/DefaultCounterComponent.kt +++ b/sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/counters/counter/DefaultCounterComponent.kt @@ -11,7 +11,7 @@ import com.arkivanov.decompose.value.Value import com.arkivanov.decompose.value.operator.map import com.arkivanov.decompose.value.update import com.arkivanov.essenty.instancekeeper.InstanceKeeper -import com.arkivanov.essenty.instancekeeper.getOrCreate +import com.arkivanov.essenty.instancekeeper.retainedInstance import com.arkivanov.sample.shared.counters.counter.CounterComponent.Model import com.arkivanov.sample.shared.dialog.DefaultDialogComponent import com.arkivanov.sample.shared.dialog.DialogComponent @@ -31,7 +31,7 @@ internal class DefaultCounterComponent( ) : CounterComponent, ComponentContext by componentContext { private val handler = - instanceKeeper.getOrCreate(KEY_STATE) { + retainedInstance { Handler( initialState = stateKeeper.consume(key = KEY_STATE, strategy = State.serializer()) ?: State(), tickScheduler = tickScheduler, diff --git a/sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/customnavigation/DefaultKittenComponent.kt b/sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/customnavigation/DefaultKittenComponent.kt index c25223295..14ba77630 100644 --- a/sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/customnavigation/DefaultKittenComponent.kt +++ b/sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/customnavigation/DefaultKittenComponent.kt @@ -6,7 +6,7 @@ import com.arkivanov.decompose.value.Value import com.arkivanov.decompose.value.operator.map import com.arkivanov.decompose.value.update import com.arkivanov.essenty.instancekeeper.InstanceKeeper -import com.arkivanov.essenty.instancekeeper.getOrCreate +import com.arkivanov.essenty.instancekeeper.retainedInstance import com.arkivanov.essenty.lifecycle.subscribe import com.arkivanov.sample.shared.ImageResourceId import com.arkivanov.sample.shared.customnavigation.KittenComponent.Model @@ -22,7 +22,7 @@ class DefaultKittenComponent( ) : KittenComponent, ComponentContext by componentContext { private val handler = - instanceKeeper.getOrCreate(KEY_STATE) { + retainedInstance { Handler(initialState = stateKeeper.consume(key = KEY_STATE, strategy = State.serializer()) ?: State()) }