wip: it works?

This commit is contained in:
Jonathan Kelley committed 2021-08-23 15:35:26 -04:00
1 parent 082765f687
commit 778baffb10
3 files changed
+103 -238

No files matched your search

+10
View File
@@ -18,6 +18,11 @@ pub enum DiffInstruction<'a> {
node: &'a VNode<'a>,
},
/// pushes the node elements onto the stack for use in mount
PrepareMoveNode {
node: &'a VNode<'a>,
},
Mount {
and: MountType<'a>,
},
@@ -34,6 +39,7 @@ pub enum MountType<'a> {
Replace { old: &'a VNode<'a> },
ReplaceByElementId { el: ElementId },
InsertAfter { other_node: &'a VNode<'a> },
InsertAfterFlush { other_node: &'a VNode<'a> },
InsertBefore { other_node: &'a VNode<'a> },
}
@@ -74,6 +80,10 @@ impl<'bump> DiffStack<'bump> {
}
}
pub fn push_nodes_created(&mut self, count: usize) {
self.nodes_created_stack.push(count);
}
pub fn create_node(&mut self, node: &'bump VNode<'bump>, and: MountType<'bump>) {
self.nodes_created_stack.push(0);
self.instructions.push(DiffInstruction::Mount { and });