Skip to content

Commit 9cc3bd3

Browse files
authored
Merge pull request #970 from arkivanov/update-LocalLifecycleOwner-docs
Updated LocalLifecycleOwner docs
2 parents b908e9e + 6fbd6d4 commit 9cc3bd3

File tree

3 files changed

+2
-70
lines changed

3 files changed

+2
-70
lines changed

docs/component/jetpack-component-context.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ By default, Decompose does nothing with `LocalLifecycleOwner`. Most likely you w
111111
interface RootComponent {
112112
val stack: Value<ChildStack<*, Child>>
113113

114-
// Child implements LifecycleOwner via delegation
115-
sealed class Child(lifecycleOwner: LifecycleOwner) : LifecycleOwner by lifecycleOwner {
114+
sealed class Child(val lifecycleOwner: LifecycleOwner) {
116115
class HomeChild(val component: HomeComponent, lifecycleOwner: LifecycleOwner) : Child(lifecycleOwner)
117116
}
118117
}
@@ -149,7 +148,7 @@ class DefaultRootComponent(
149148
fun RootContent(component: RootComponent) {
150149
Children(stack = component.stack) {
151150
// Provide LocalLifecycleOwner for child screens
152-
CompositionLocalProvider(LocalLifecycleOwner provides it.instance) {
151+
CompositionLocalProvider(LocalLifecycleOwner provides it.instance.lifecycleOwner) {
153152
when (val child = it.instance) {
154153
is RootComponent.Child.HomeChild -> HomeContent(child.component)
155154
}

sample/app-android/build.gradle.kts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import com.arkivanov.gradle.setupAndroidApp
33
plugins {
44
id("com.android.application")
55
id("kotlin-android")
6-
id("kotlinx-serialization")
76
id("org.jetbrains.compose")
87
id("org.jetbrains.kotlin.plugin.compose")
98
id("com.arkivanov.gradle.setup")
@@ -28,9 +27,7 @@ android {
2827

2928
dependencies {
3029
implementation(project(":decompose"))
31-
implementation(project(":jetpack-component-context"))
3230
implementation(project(":extensions-android"))
33-
implementation(project(":extensions-compose"))
3431
implementation(project(":sample:shared:shared"))
3532
implementation(project(":sample:shared:compose"))
3633
implementation(compose.runtime)

sample/app-android/src/main/java/com/arkivanov/sample/app/Foo.kt

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)