freya_router/utils/
use_router_internal.rs

1use freya_core::prelude::*;
2
3use crate::prelude::*;
4
5/// A private hook to subscribe to the router.
6///
7/// Used to reduce redundancy within other components/hooks. Safe to call multiple times for a
8/// single component, but not recommended. Multiple subscriptions will be discarded.
9///
10/// # Return values
11/// - [`None`], when the current component isn't a descendant of a [`Router`] component.
12/// - Otherwise [`Some`].
13pub(crate) fn use_router_internal() -> Option<RouterContext> {
14    use_try_consume()
15}