NavigationGuard

A suspend function evaluated before navigation is committed.

Returns a GuardResult to allow, reject, or redirect the navigation.

Example:

val requireAuth: NavigationGuard = { store ->
if (store.selectState<AuthState>().value.isAuthenticated) GuardResult.Allow
else GuardResult.RedirectTo(LoginScreen)
}