chore: more refactoring, docs

This commit is contained in:
Jonathan Kelley committed 2022-11-11 18:29:27 -08:00
1 parent f7df6a9893
commit c44bd11fe5
27 files changed
+657 -382

No files matched your search

+7 -10
View File
@@ -1,4 +1,4 @@
use std::{cell::Cell, fmt::Arguments, pin::Pin};
use std::{cell::Cell, fmt::Arguments};
use bumpalo::boxed::Box as BumpBox;
use bumpalo::Bump;
@@ -123,13 +123,6 @@ where
}
}
#[test]
fn takes_it() {
fn demo(cx: Scope) -> Element {
todo!()
}
}
pub enum RenderReturn<'a> {
Sync(Element<'a>),
Async(BumpBox<'a, dyn Future<Output = Element<'a>> + 'a>),
@@ -144,8 +137,6 @@ impl<'a> RenderReturn<'a> {
}
}
pub type FiberLeaf<'a> = Pin<BumpBox<'a, dyn Future<Output = Element<'a>> + 'a>>;
pub trait IntoVnode<'a, A = ()> {
fn into_dynamic_node(self, cx: &'a ScopeState) -> VNode<'a>;
}
@@ -162,6 +153,12 @@ impl<'a, 'b> IntoVnode<'a> for VNode<'a> {
}
}
impl<'a, 'b> IntoVnode<'a> for Option<VNode<'a>> {
fn into_dynamic_node(self, _cx: &'a ScopeState) -> VNode<'a> {
self.expect("please allow optional nodes in")
}
}
impl<'a, 'b> IntoVnode<'a> for &'a VNode<'a> {
fn into_dynamic_node(self, _cx: &'a ScopeState) -> VNode<'a> {
VNode {