freya_router/hooks/
use_router.rs

1
2
3
4
5
6
7
8
9
10
11
use crate::prelude::RouterContext;

/// Acquire the router without subscribing to updates.
pub fn router() -> RouterContext {
    dioxus_lib::prelude::consume_context()
}

/// Try to acquire the router without subscribing to updates.
pub fn try_router() -> Option<RouterContext> {
    dioxus_lib::prelude::try_consume_context()
}