Skip to content

Commit

Permalink
expose backstack count
Browse files Browse the repository at this point in the history
  • Loading branch information
Tlaster committed Mar 8, 2024
1 parent 96b2ffc commit db417c1
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package moe.tlaster.precompose.navigation

import androidx.compose.runtime.Composable
import kotlinx.coroutines.flow.map
import moe.tlaster.precompose.lifecycle.LifecycleOwner
import moe.tlaster.precompose.stateholder.SavedStateHolder
import moe.tlaster.precompose.stateholder.StateHolder
Expand Down Expand Up @@ -148,4 +149,9 @@ class Navigator {
* @ return Returns the previous navigation back stack entry.
*/
val previousEntry = stackManager.prevBackStackEntry

/**
* Number of routes in the back stack
*/
val backStackCount = stackManager.backStacks.map { it.size }
}

0 comments on commit db417c1

Please sign in to comment.