Current section
Files
Jump to
Current section
Files
priv/templates/integrations/gpui/src/bin/web.rs.eex
#![no_main]
use std::cell::OnceCell;
thread_local! {
static APPLICATION: OnceCell<gpui::ApplicationHandle> = const { OnceCell::new() };
}
#[wasm_bindgen::prelude::wasm_bindgen(start)]
pub fn start() {
gpui_platform::web_init();
let application = gpui_platform::application().run_embedded(<%= @crate_name %>::open);
APPLICATION.with(|slot| {
assert!(
slot.set(application).is_ok(),
"the application was already started"
);
});
}