lightspeed/navigation
LiveView-style navigation compatibility planner.
Types
Mount boundary outcome for one navigation transition.
pub type MountBoundary {
PreserveMount
Remount
}
Constructors
-
PreserveMount -
Remount
Navigation semantics compatible with LiveView patch/navigate.
pub type NavigationMode {
LivePatch
LiveNavigate
}
Constructors
-
LivePatch -
LiveNavigate
Planned navigation transition and resulting instructions.
pub type NavigationPlan(msg) {
NavigationPlan(
mode: NavigationMode,
boundary: MountBoundary,
current: router.RouteMatch(msg),
next: router.RouteMatch(msg),
instructions: List(isa.Instruction),
)
}
Constructors
-
NavigationPlan( mode: NavigationMode, boundary: MountBoundary, current: router.RouteMatch(msg), next: router.RouteMatch(msg), instructions: List(isa.Instruction), )
Values
pub fn boundary_label(boundary: MountBoundary) -> String
Stable mount boundary string for logs and fixtures.
pub fn instructions(
plan: NavigationPlan(msg),
) -> List(isa.Instruction)
Planned route instructions in emit order.
pub fn mode_label(mode: NavigationMode) -> String
Stable mode string for logs and fixtures.
pub fn plan(
table: router.Router(msg),
current_path: String,
target_path: String,
csrf_token: String,
) -> NavigationPlan(msg)
Plan one route transition using LiveView-compatible navigation semantics.