Skip to content

Commit

Permalink
Updated currentKeyAsState() function
Browse files Browse the repository at this point in the history
  • Loading branch information
chRyNaN committed Dec 30, 2021
1 parent 3c5d79d commit 1bc7c78
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ import androidx.compose.runtime.collectAsState
*/
@ExperimentalNavigationApi
@Composable
fun <T> ComposeNavigator<T>.currentKeyAsState(): State<T?> = keyChanges.collectAsState(initial = currentKey)
fun <T> ComposeNavigator<T>.currentKeyAsState(initialCurrentKey: T? = currentKey): State<T?> =
keyChanges.collectAsState(initial = initialCurrentKey)

0 comments on commit 1bc7c78

Please sign in to comment.