noop attribute 'spreading' for routers

This commit is contained in:
Greg Johnston 2024-05-04 17:11:01 -04:00
parent cebe744a84
commit cfba7a2797
2 changed files with 42 additions and 0 deletions

View File

@ -30,6 +30,7 @@ use tachys::{
renderer::Renderer,
ssr::StreamBuilder,
view::{
add_attr::AddAnyAttr,
any_view::{AnyView, AnyViewState, IntoAny},
either::EitherState,
Mountable, Position, PositionState, Render, RenderHtml,
@ -105,6 +106,26 @@ where
}
}
impl<Defs, Fal, R> AddAnyAttr<R> for FlatRoutesView<Defs, Fal, R>
where
Defs: MatchNestedRoutes<R> + Send,
Fal: RenderHtml<R>,
R: Renderer + 'static,
{
type Output<SomeNewAttr: leptos::attr::Attribute<R>> =
FlatRoutesView<Defs, Fal, R>;
fn add_any_attr<NewAttr: leptos::attr::Attribute<R>>(
self,
attr: NewAttr,
) -> Self::Output<NewAttr>
where
Self::Output<NewAttr>: RenderHtml<R>,
{
todo!()
}
}
impl<Defs, Fal, R> RenderHtml<R> for FlatRoutesView<Defs, Fal, R>
where
Defs: MatchNestedRoutes<R> + Send,

View File

@ -30,6 +30,7 @@ use tachys::{
renderer::Renderer,
ssr::StreamBuilder,
view::{
add_attr::AddAnyAttr,
any_view::{AnyView, AnyViewState, IntoAny},
either::EitherState,
Mountable, Position, PositionState, Render, RenderHtml,
@ -140,6 +141,26 @@ where
}
}
impl<Defs, Fal, R> AddAnyAttr<R> for NestedRoutesView<Defs, Fal, R>
where
Defs: MatchNestedRoutes<R> + Send,
Fal: RenderHtml<R>,
R: Renderer + 'static,
{
type Output<SomeNewAttr: leptos::attr::Attribute<R>> =
NestedRoutesView<Defs, Fal, R>;
fn add_any_attr<NewAttr: leptos::attr::Attribute<R>>(
self,
attr: NewAttr,
) -> Self::Output<NewAttr>
where
Self::Output<NewAttr>: RenderHtml<R>,
{
todo!()
}
}
impl<Defs, Fal, R> RenderHtml<R> for NestedRoutesView<Defs, Fal, R>
where
Defs: MatchNestedRoutes<R> + Send,