1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! Client-side navigation for browser-based Tairitsu apps.
//!
//! Provides URL-aware routing: reads current pathname, pushes history state,
//! intercepts `<a>` click events for SPA-style navigation, and integrates
//! with the reactive system so route changes trigger re-renders.
//!
//! # Example
//!
//! ```ignore
//! use tairitsu_web::navigation;
//! use tairitsu_vdom::VNode;
//!
//! // 1. Start intercepting link clicks inside #app
//! navigation::intercept_links();
//!
//! // 2. Get current path for initial render
//! let path = navigation::current_path();
//!
//! // 3. Later, navigate programmatically
//! navigation::navigate("/components/layer1/button");
//! ```
use cratewit_platform;
/// Read the current URL pathname.
///
/// Returns `/` if not running in wasm.
/// Navigate to a new path (pushState + trigger re-render).
///
/// Updates browser URL via `history.pushState` without page reload.
/// Replace current URL (replaceState).