From 8d3e2ade7aef491921bb51f0d35b7253bbc800f8 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Wed, 24 Feb 2021 04:03:52 -0500 Subject: [PATCH] Feat: buff up examples and docs --- packages/web/examples/hello.rs | 2 -- packages/web/src/lib.rs | 9 +++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/web/examples/hello.rs b/packages/web/examples/hello.rs index acc9f5ff4..e87dcb358 100644 --- a/packages/web/examples/hello.rs +++ b/packages/web/examples/hello.rs @@ -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)); } diff --git a/packages/web/src/lib.rs b/packages/web/src/lib.rs index bde261993..1375e008e 100644 --- a/packages/web/src/lib.rs +++ b/packages/web/src/lib.rs @@ -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<()>) {