clean up node mut api

This commit is contained in:
Evan Almloff committed 2023-02-09 13:24:45 -06:00
1 parent 0f6eb4fca2
commit 5b822201f7
2 files changed
+11 -2

No files matched your search

+5
View File
@@ -420,6 +420,11 @@ impl<'a, V: FromAnyValue + Send + Sync> NodeMut<'a, V> {
self.dom
}
#[inline]
pub fn parent_mut(&mut self) -> Option<NodeMut<V>> {
self.parent_id().map(|id| NodeMut { id, dom: self.dom })
}
#[inline]
pub fn get_mut<T: Any + Sync + Send>(&mut self) -> Option<&mut T> {
// mark the node state as dirty