mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-12-19 00:53:12 +00:00
27 lines
778 B
Rust
27 lines
778 B
Rust
use crate::{nodes::VNode, scopes::ScopeId, virtual_dom::VirtualDom, DynamicNode};
|
|
|
|
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 {
|
|
DynamicNode::Text { id, .. } => {}
|
|
|
|
DynamicNode::Component { .. } => {
|
|
todo!()
|
|
}
|
|
|
|
DynamicNode::Fragment(children) => {}
|
|
DynamicNode::Placeholder(_) => todo!(),
|
|
}
|
|
}
|
|
}
|
|
}
|