allow nodes to depend on the listeners of a node

This commit is contained in:
Evan Almloff committed 2022-04-21 15:10:53 -05:00
1 parent cebf17088b
commit 7b35566169
2 files changed
+15

No files matched your search

+2
View File
@@ -152,6 +152,7 @@ impl<S: State> RealDom<S> {
scope: _,
root,
} => {
nodes_updated.push((root as usize, NodeMask::new().with_listeners()));
if let Some(v) = self.nodes_listening.get_mut(event_name) {
v.insert(root as usize);
} else {
@@ -161,6 +162,7 @@ impl<S: State> RealDom<S> {
}
}
RemoveEventListener { root, event } => {
nodes_updated.push((root as usize, NodeMask::new().with_listeners()));
let v = self.nodes_listening.get_mut(event).unwrap();
v.remove(&(root as usize));
}