Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make launch functions pub #1288

Merged
merged 2 commits into from
Aug 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions packages/fullstack/src/launch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,21 +119,22 @@ impl<Props: Clone + serde::Serialize + serde::de::DeserializeOwned + Send + Sync
}

#[cfg(feature = "web")]
fn launch_web(self) {
/// Launch the web application
pub fn launch_web(self) {
ealmloff marked this conversation as resolved.
Show resolved Hide resolved
let cfg = self.web_cfg.hydrate(true);
dioxus_web::launch_with_props(self.component, get_root_props_from_document().unwrap(), cfg);
}

#[cfg(feature = "desktop")]
fn launch_desktop(self) {
/// Launch the web application
pub fn launch_desktop(self) {
let cfg = self.desktop_cfg;
dioxus_desktop::launch_with_props(self.component, self.props, cfg);
}

/// Launch a server with the given configuration
/// This will use the routing integration of the currently enabled integration feature
#[cfg(feature = "ssr")]
async fn launch_server(self) {
/// Launch a server application
pub async fn launch_server(self) {
let addr = self.addr;
println!("Listening on {}", addr);
let cfg = self.server_cfg.build();
Expand Down
Loading