feat: simple tests passing

This commit is contained in:
Jonathan Kelley committed 2022-11-01 18:42:29 -07:00
1 parent 23603aaaf5
commit 4a31b29703
27 files changed
+1565 -372

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
use crate::{
nodes::{DynamicNodeKind, VNode},
scopes::ScopeId,
virtualdom::VirtualDom,
};
impl VirtualDom {
pub fn drop_scope(&mut self, id: ScopeId) {
let scope = self.scopes.get(id.0).unwrap();
let root = scope.root_node();
let root = unsafe { std::mem::transmute(root) };
self.drop_template(root);
}
pub fn drop_template<'a>(&'a mut self, template: &'a VNode<'a>) {
for node in template.dynamic_nodes.iter() {
match &node.kind {
DynamicNodeKind::Text { id, .. } => {}
DynamicNodeKind::Component { .. } => {
todo!()
}
DynamicNodeKind::Fragment { children } => {}
}
}
}
}