NavigationLogic

class NavigationLogic(val storeAccessor: StoreAccessor, precomputedData: PrecomputedNavigationData, parameterEncoder: DualNavigationParameterEncoder = DualNavigationParameterEncoder(), onCrash: suspend (Throwable, ModuleAction?) -> CrashRecovery? = null) : ModuleLogic(source)

Side-effecting logic for the navigation system.

NavigationLogic orchestrates all navigation operations — guard evaluation, entry-point resolution, back-stack synthesis, deep-link handling, and lifecycle callbacks. It is created automatically by NavigationModule and registered with the store.

The preferred way to trigger navigation from application code is via the StoreAccessor extension functions (navigation { }, navigateBack(), etc.) which delegate to the public methods on this class. Direct access via storeAccessor.selectLogic<NavigationLogic>() is also supported when finer control is needed.

// Typical usage via extension (recommended)
storeAccessor.navigation {
navigateTo(ProfileScreen)
}

// Or directly
val navLogic = storeAccessor.selectLogic<NavigationLogic>()
navLogic.navigate { navigateTo(ProfileScreen) }

See also

Constructors

Link copied to clipboard
constructor(storeAccessor: StoreAccessor, precomputedData: PrecomputedNavigationData, parameterEncoder: DualNavigationParameterEncoder = DualNavigationParameterEncoder(), onCrash: suspend (Throwable, ModuleAction?) -> CrashRecovery? = null)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open suspend override fun beforeReset()
Link copied to clipboard
suspend fun clearBackStack(newRoute: String? = null, params: Params = Params.empty())

Clear the entire backstack and optionally navigate to a new route.

Link copied to clipboard
suspend fun navigate(block: suspend NavigationBuilder.() -> Unit): NavigationOutcome

Execute a navigation operation. Evaluates intercept guards and entry definitions before committing navigation.

suspend fun navigate(route: String, params: Params = Params.empty(), replaceCurrent: Boolean = false, config: NavigationBuilder.() -> Unit? = null): NavigationOutcome

Navigate to a route with optional parameters and configuration.

Link copied to clipboard
suspend fun navigateBack()

Navigate back in the navigation stack.

Link copied to clipboard
suspend fun navigateDeepLink(route: String, params: Params = Params.empty())

Navigate to a deep link route with guard evaluation. Checks alias mappings first before resolving the route normally.

Link copied to clipboard
suspend fun popUpTo(route: String, inclusive: Boolean = false, fallback: String? = null)

Pop up to a specific route in the backstack.