use super::*;
impl NestedRouteConfig {
pub fn new<P, F>(path: P, component: F, children: Vec<NestedRouteConfig>) -> Self
where
P: Into<String>,
F: Fn() -> VirtualNode + 'static,
{
Self {
path: path.into(),
component: Rc::new(component),
children,
}
}
pub fn component(&self) -> Rc<dyn Fn() -> VirtualNode> {
self.get_component().clone()
}
pub fn children(&self) -> &[NestedRouteConfig] {
self.get_children()
}
}