Skip to content

Commit

Permalink
Expose AndroidLifecycle for Android targets + create a helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
KovalevAndrey committed Sep 1, 2023
1 parent 9fa482a commit 42d07b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.bumble.appyx.navigation.platform

import com.bumble.appyx.navigation.node.Node

val Node.androidLifecycle: androidx.lifecycle.Lifecycle
get() = (lifecycle as PlatformLifecycleRegistry).androidLifecycleRegistry
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ actual class PlatformLifecycleRegistry(
androidx.lifecycle.LifecycleEventObserver {

private var lifecycleOwner: LifecycleOwner? = androidOwner
private val androidLifecycleRegistry = LifecycleRegistry(androidOwner)
val androidLifecycleRegistry = LifecycleRegistry(androidOwner)

private val managedDefaultLifecycleObservers: MutableList<DefaultPlatformLifecycleObserver> =
ArrayList()
Expand Down

0 comments on commit 42d07b5

Please sign in to comment.