wip: error boundary

This commit is contained in:
Jonathan Kelley committed 2022-11-22 18:38:27 -08:00
1 parent 112c954e00
commit 0e5a59f9ed
17 files changed
+343 -316

No files matched your search

+6 -4
View File
@@ -3,6 +3,8 @@ mod arena;
mod bump_frame;
mod create;
mod diff;
mod dirty_scope;
mod error_boundary;
mod events;
mod factory;
mod fragment;
@@ -15,9 +17,9 @@ mod scheduler;
mod scope_arena;
mod scopes;
mod virtual_dom;
pub(crate) mod innerlude {
pub use crate::arena::*;
pub use crate::dirty_scope::*;
pub use crate::events::*;
pub use crate::fragment::*;
pub use crate::lazynodes::*;
@@ -28,10 +30,10 @@ pub(crate) mod innerlude {
pub use crate::scopes::*;
pub use crate::virtual_dom::*;
/// An [`Element`] is a possibly-none [`VNode`] created by calling `render` on [`Scope`] or [`ScopeState`].
/// An [`Element`] is a possibly-errored [`VNode`] created by calling `render` on [`Scope`] or [`ScopeState`].
///
/// Any [`None`] [`Element`] will automatically be coerced into a placeholder [`VNode`] with the [`VNode::Placeholder`] variant.
pub type Element<'a> = Option<VNode<'a>>;
/// An Errored [`Element`] will propagate the error to the nearest error boundary.
pub type Element<'a> = anyhow::Result<VNode<'a>>;
/// A [`Component`] is a function that takes a [`Scope`] and returns an [`Element`].
///