provide feature hints for the dioxus crate as well

This commit is contained in:
Evan Almloff committed 2024-02-09 12:23:57 -06:00
1 parent b4d17abfc1
commit 162b033c36
8 files changed
+59 -22

No files matched your search

+4 -4
View File
@@ -140,12 +140,12 @@ impl ErrorBoundary {
///
/// ```rust, ignore
/// #[component]
/// fn app( count: String) -> Element {
/// fn app(count: String) -> Element {
/// let id: i32 = count.parse().throw()?;
///
/// rsx! {
/// div { "Count {}" }
/// })
/// }
/// }
/// ```
pub trait Throw<S = ()>: Sized {
@@ -170,7 +170,7 @@ pub trait Throw<S = ()>: Sized {
///
/// rsx! {
/// div { "Count {}" }
/// })
/// }
/// }
/// ```
fn throw(self) -> Option<Self::Out>;
@@ -193,7 +193,7 @@ pub trait Throw<S = ()>: Sized {
///
/// rsx! {
/// div { "Count {}" }
/// })
/// }
/// }
/// ```
fn throw_with<D: Debug + 'static>(self, e: impl FnOnce() -> D) -> Option<Self::Out> {
+1 -1
View File
@@ -159,7 +159,7 @@ impl<T: std::fmt::Debug> std::fmt::Debug for Event<T> {
/// button {
/// onclick: move |evt| cx.onclick.call(evt),
/// }
/// })
/// }
/// }
///
/// ```
+2 -2
View File
@@ -42,7 +42,7 @@ pub(crate) mod innerlude {
/// An Errored [`Element`] will propagate the error to the nearest error boundary.
pub type Element = Option<VNode>;
/// A [`Component`] is a function that takes a [`Scope`] and returns an [`Element`].
/// A [`Component`] is a function that takes [`Properties`] and returns an [`Element`].
///
/// Components can be used in other components with two syntax options:
/// - lowercase as a function call with named arguments (rust style)
@@ -84,7 +84,7 @@ pub use crate::innerlude::{
/// The purpose of this module is to alleviate imports of many common types
///
/// This includes types like [`Scope`], [`Element`], and [`Component`].
/// This includes types like [`Element`], and [`Component`].
pub mod prelude {
pub use crate::innerlude::{
consume_context, consume_context_from_scope, current_scope_id, fc_to_builder, flush_sync,
+3 -3
View File
@@ -24,7 +24,7 @@ use std::{any::Any, collections::BTreeSet, rc::Rc};
///
/// ## Guide
///
/// Components are defined as simple functions that take [`Scope`] and return an [`Element`].
/// Components are defined as simple functions that take [`crate::properties::Properties`] and return an [`Element`].
///
/// ```rust
/// # use dioxus::prelude::*;
@@ -218,7 +218,7 @@ impl VirtualDom {
/// # Example
/// ```rust, ignore
/// fn Example() -> Element {
/// rsx!( div { "hello world" } ))
/// rsx!( div { "hello world" } )
/// }
///
/// let dom = VirtualDom::new(Example);
@@ -526,7 +526,7 @@ impl VirtualDom {
///
/// # Example
/// ```rust, ignore
/// static app: Component = |cx| rsx!{ "hello world" });
/// static app: Component = |cx| rsx!{ "hello world" };
///
/// let mut dom = VirtualDom::new();
/// let edits = dom.rebuild();