1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-27 15:13:12 -04:00

Make use of AppRunnerRef

This commit is contained in:
Emil Ernerfeldt
2022-08-02 17:37:12 +02:00
parent 7d5998062b
commit 9419903d68
2 changed files with 6 additions and 17 deletions

View File

@@ -76,12 +76,6 @@ pub use epi::*;
// ----------------------------------------------------------------------------
// When compiling for web
#[cfg(target_arch = "wasm32")]
use egui::mutex::Mutex;
#[cfg(target_arch = "wasm32")]
use std::sync::Arc;
#[cfg(target_arch = "wasm32")]
pub mod web;
@@ -89,7 +83,8 @@ pub mod web;
pub use wasm_bindgen;
#[cfg(target_arch = "wasm32")]
use web::AppRunner;
use web::AppRunnerRef;
#[cfg(target_arch = "wasm32")]
pub use web_sys;
@@ -107,7 +102,7 @@ pub use web_sys;
/// /// You can add more callbacks like this if you want to call in to your code.
/// #[cfg(target_arch = "wasm32")]
/// #[wasm_bindgen]
/// pub fn start(canvas_id: &str) -> Result<Arc<Mutex<AppRunner>>, eframe::wasm_bindgen::JsValue> {
/// pub fn start(canvas_id: &str) -> Result<AppRunnerRef>, eframe::wasm_bindgen::JsValue> {
/// let web_options = eframe::WebOptions::default();
/// eframe::start_web(canvas_id, web_options, Box::new(|cc| Box::new(MyEguiApp::new(cc))))
/// }
@@ -117,7 +112,7 @@ pub fn start_web(
canvas_id: &str,
web_options: WebOptions,
app_creator: AppCreator,
) -> Result<Arc<Mutex<AppRunner>>, wasm_bindgen::JsValue> {
) -> Result<AppRunnerRef, wasm_bindgen::JsValue> {
let handle = web::start(canvas_id, web_options, app_creator)?;
Ok(handle)