mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 14:54:16 +00:00
fix: extract dyn_bindings impl into DynBindings trait (#2619)
This commit is contained in:
parent
00a42daa63
commit
b22f3bb3bd
2 changed files with 16 additions and 1 deletions
|
@ -285,6 +285,21 @@ pub trait DynAttrs {
|
|||
|
||||
impl DynAttrs for () {}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub trait DynBindings {
|
||||
fn dyn_bindings<B: Into<Binding>>(
|
||||
self,
|
||||
_args: impl IntoIterator<Item = B>,
|
||||
) -> Self
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl DynBindings for () {}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub trait PropsOrNoPropsBuilder {
|
||||
type Builder;
|
||||
|
|
|
@ -543,7 +543,7 @@ impl ToTokens for Model {
|
|||
}
|
||||
}
|
||||
|
||||
impl #impl_generics #props_name #generics #where_clause {
|
||||
impl #impl_generics ::leptos::DynBindings for #props_name #generics #where_clause {
|
||||
fn dyn_bindings<B: Into<::leptos::leptos_dom::html::Binding>>(mut self, bindings: impl std::iter::IntoIterator<Item = B>) -> Self {
|
||||
for binding in bindings.into_iter() {
|
||||
let binding: ::leptos::leptos_dom::html::Binding = binding.into();
|
||||
|
|
Loading…
Reference in a new issue