wip: add diffing tests
This commit is contained in:
1 parent
4bfd936e12
commit
662f58c8bc
5 files changed
+76
-3
No files matched your search
@@ -195,10 +195,11 @@ impl<'b: 'static> VirtualDom {
|
||||
/// }
|
||||
/// ```
|
||||
fn light_diff_templates(&mut self, left: &'b VNode<'b>, right: &'b VNode<'b>) {
|
||||
if let Some(components) = matching_components(left, right) {
|
||||
components
|
||||
match matching_components(left, right) {
|
||||
None => self.replace_template(left, right),
|
||||
Some(components) => components
|
||||
.into_iter()
|
||||
.for_each(|(l, r)| self.diff_vcomponent(l, r))
|
||||
.for_each(|(l, r)| self.diff_vcomponent(l, r)),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -654,6 +655,10 @@ impl<'b: 'static> VirtualDom {
|
||||
}
|
||||
}
|
||||
|
||||
fn replace_template(&mut self, left: &'b VNode<'b>, right: &'b VNode<'b>) {
|
||||
todo!("replacing should work!")
|
||||
}
|
||||
|
||||
fn replace(
|
||||
&mut self,
|
||||
left_template: &'b VNode<'b>,
|
||||
|
||||
Reference in new issue
Block a user