wip: groundwork for noderefs
This commit is contained in:
1 parent
a44e9fcffa
commit
c1afeba1ef
21 files changed
+184
-103
No files matched your search
@@ -256,3 +256,31 @@ impl<'src> SuspendedContext<'src> {
|
||||
Some(lazy_nodes.into_vnode(NodeFactory { bump }))
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct NodeRef<'src, T: 'static>(&'src RefCell<T>);
|
||||
|
||||
// impl NodeRef<'src, T> {
|
||||
// fn set_ref(&self, new: Box<dyn Any>)
|
||||
// }
|
||||
// impl<'a, T> std::ops::Deref for NodeRef<'a, T> {
|
||||
// type Target = Option<&'a T>;
|
||||
|
||||
// fn deref(&self) -> &Self::Target {
|
||||
// // &self.node
|
||||
// }
|
||||
// }
|
||||
|
||||
pub fn use_node_ref<T, P>(cx: Context<P>) -> NodeRef<T> {
|
||||
cx.use_hook(
|
||||
|f| {},
|
||||
|f| {
|
||||
//
|
||||
todo!()
|
||||
// NodeRef {}
|
||||
},
|
||||
|f| {
|
||||
//
|
||||
},
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user