diff --git a/packages/dioxus/src/launch.rs b/packages/dioxus/src/launch.rs index 35de2321c..3e08c8578 100644 --- a/packages/dioxus/src/launch.rs +++ b/packages/dioxus/src/launch.rs @@ -123,7 +123,33 @@ impl LaunchBuilder { /// Provide a custom launch function for your application. /// /// Useful for third party renderers to tap into the launch builder API without having to reimplement it. - pub fn custom(launch_fn: LaunchFn) -> LaunchBuilder { + /// + /// # Example + /// ```rust, no_run + /// use dioxus::prelude::*; + /// use std::any::Any; + /// + /// #[derive(Default)] + /// struct Config; + /// + /// fn my_custom_launcher(root: fn() -> Element, contexts: Vec>, cfg: Config) { + /// println!("launching with root: {:?}", root()); + /// loop { + /// println!("running..."); + /// } + /// } + /// + /// fn app() -> Element { + /// rsx! { + /// div { "Hello, world!" } + /// } + /// } + /// + /// LaunchBuilder::custom(my_custom_launcher).launch(app); + /// ``` + pub fn custom( + launch_fn: LaunchFn, + ) -> LaunchBuilder { LaunchBuilder { launch_fn, contexts: vec![],