Feat: buff up examples and docs

This commit is contained in:
Jonathan Kelley committed 2021-02-24 04:03:52 -05:00
1 parent 06ae4fc178
commit 8d3e2ade7a
2 files changed
+9 -2

No files matched your search

-2
View File
@@ -2,8 +2,6 @@ use dioxus_core::prelude::*;
use dioxus_web::WebsysRenderer;
fn main() {
// todo: set this up so the websys render can spawn itself rather than having to wrap it
// almost like bundling an executor with the wasm version
wasm_bindgen_futures::spawn_local(WebsysRenderer::start(Example));
}
+9
View File
@@ -25,6 +25,15 @@ pub struct WebsysRenderer {
}
impl WebsysRenderer {
/// This method is the primary entrypoint for Websys Dioxus apps. Will panic if an error occurs while rendering.
/// See DioxusErrors for more information on how these errors could occour.
///
/// ```ignore
/// fn main() {
/// wasm_bindgen_futures::spawn_local(WebsysRenderer::start(Example));
/// }
/// ```
///
/// Run the app to completion, panicing if any error occurs while rendering.
/// Pairs well with the wasm_bindgen async handler
pub async fn start(root: FC<()>) {