pub fn run<Msg: crate::EmptyMessage + 'static>(&mut self, view: &mut dyn View<Msg>) {
        #[cfg(not(target_arch = "wasm32"))]
        self.run_(view);

        #[cfg(target_arch = "wasm32")] {
            std::panic::set_hook(Box::new(console_error_panic_hook::hook));
            console_log::init().unwrap();
            
            // TEMP: Remove this once confirmed working
            log::info!("Test");

            use winit::platform::web::WindowExtWebSys;
            web_sys::window()
                .and_then(|win| win.document())
                .and_then(|doc| doc.body())
                .and_then(|body| {
                    body.append_child(&web_sys::Element::from(self.window_system.window.canvas()))
                        .ok()
                })
                .expect("Couldn't append canvas to document body");

            self.run_(view);
        }
    }
/// Runs the application with the given view. Targets web if `target_arch` is wasm32
Runs the application with the given view. Targets web if `target_arch` is wasm32
Runs the application with the given view . Targets web if ` target_arch ` is wasm32
pub fn run<Msg: crate::EmptyMessage + 'static>(&mut self, view: &mut dyn View<Msg>) {
        #[cfg(not(target_arch = "wasm32"))]
        self.run_(view);
        #[cfg(target_arch = "wasm32")] {
            std::panic::set_hook(Box::new(console_error_panic_hook::hook));
            console_log::init().unwrap();
            // TEMP: Remove this once confirmed working
            log::info!("Test");
            use winit::platform::web::WindowExtWebSys;
            web_sys::window()
                .and_then(|win| win.document())
                .and_then(|doc| doc.body())
                .and_then(|body| {
                    body.append_child(&web_sys::Element::from(self.window_system.window.canvas()))
                        .ok()
                })
                .expect("Couldn't append canvas to document body");
            self.run_(view);
        }
    }
pub fn run < Msg : crate :: EmptyMessage + ' static > ( & mut self , view : & mut dyn View < Msg > ) { # [ cfg ( not ( target_arch " " ) ) ] self . run_ ( view ) ; # [ cfg ( target_arch " " ) ] { std :: panic :: set_hook ( Box :: new ( console_error_panic_hook :: hook ) ) ; console_log :: init ( ) . unwrap ( ) ; // TEMP: Remove this once confirmed working log :: info ! ( " " ) ; use winit :: platform :: web :: WindowExtWebSys ; web_sys :: window ( ) . and_then ( | win | win . document ( ) ) . and_then ( | doc | doc . body ( ) ) . and_then ( | body | { body . append_child ( & web_sys :: Element :: from ( self . window_system . window . canvas ( ) ) ) . ok ( ) } ) . expect ( " " ) ; self . run_ ( view ) ; } }
Runs the application with the given view.
Runs the application with the given view .
&mut self
view
&mut dyn View<Msg>
&mut self
view
&mut dyn View<Msg>