feat: beaf up the use_state hook

This commit is contained in:
Jonathan Kelley committed 2021-07-08 09:29:12 -04:00
1 parent 7aec40d57e
commit e4cdb645aa
11 files changed
+214 -218

No files matched your search

+2 -15
View File
@@ -549,13 +549,8 @@ impl<'a> IntoVNode<'a> for VNode<'a> {
}
impl<'a> IntoVNode<'a> for &VNode<'a> {
fn into_vnode(self, cx: NodeFactory<'a>) -> VNode<'a>
// where
// 'a: 'c,
{
todo!()
// cloning is cheap since vnodes are just references into bump arenas
// self.clone()
fn into_vnode(self, cx: NodeFactory<'a>) -> VNode<'a> {
self.clone()
}
}
@@ -563,14 +558,6 @@ pub trait IntoVNode<'a> {
fn into_vnode(self, cx: NodeFactory<'a>) -> VNode<'a>;
}
// pub trait VNodeBuilder<'a, G>: IntoIterator<Item = G>
// where
// G: IntoVNode<'a>,
// {
// }
// impl<'a, F> VNodeBuilder<'a, LazyNodes<F>> for LazyNodes<F> where F: FnOnce(NodeFactory) -> VNode {}
// Wrap the the node-builder closure in a concrete type.
// ---
// This is a bit of a hack to implement the IntoVNode trait for closure types.