All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.captain.NavigationUtils.kt Maven / Gradle / Ivy

There is a newer version: 3.0.13
Show newest version
@file:Suppress("NOTHING_TO_INLINE")

package captain

import kiota.Url
import androidx.compose.runtime.Composable
import androidx.compose.runtime.compositionLocalOf
import cinematic.watchAsState
import kiota.QueryParams

@PublishedApi
internal val LocalNavigator = compositionLocalOf { BasicNavigator("/") }

@PublishedApi
internal val LocalNavigateReference = compositionLocalOf { Url("/") }

@Composable
inline fun rememberNavigator(): Navigator = LocalNavigator.current

@Composable
inline fun Navigate(to: String) {
    val navigate = rememberNavigate()
    navigate(to)
}

@Composable
inline fun rememberNavigate(): NavigateFunction = NavigateFunction(LocalNavigator.current, LocalNavigateReference.current)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy