convert T into signals automatically

This commit is contained in:
Evan Almloff committed 2024-01-29 13:36:39 -06:00
1 parent 1847c737e9
commit 50e3216d8b
14 files changed
+441 -103

No files matched your search

+12 -3
View File
@@ -32,7 +32,16 @@ pub trait Properties: Clone + Sized + 'static {
fn builder() -> Self::Builder;
/// Compare two props to see if they are memoizable.
fn memoize(&self, other: &Self) -> bool;
fn memoize(&mut self, other: &Self) -> bool;
/// Create a component from the props.
fn into_vcomponent<M: 'static>(
self,
render_fn: impl ComponentFunction<Self, M>,
component_name: &'static str,
) -> VComponent {
VComponent::new(render_fn, self, component_name)
}
}
impl Properties for () {
@@ -40,7 +49,7 @@ impl Properties for () {
fn builder() -> Self::Builder {
EmptyBuilder {}
}
fn memoize(&self, _other: &Self) -> bool {
fn memoize(&mut self, _other: &Self) -> bool {
true
}
}
@@ -65,7 +74,7 @@ where
fn builder() -> Self::Builder {
todo!()
}
fn memoize(&self, _other: &Self) -> bool {
fn memoize(&mut self, _other: &Self) -> bool {
true
}
}