Fix cargo test and a number of little cleanup bugs

This commit is contained in:
Jonathan Kelley committed 2024-01-30 17:33:14 -08:00
1 parent eff1dd6c90
commit 0bd9692e45
49 files changed
+307 -309

No files matched your search

+11 -13
View File
@@ -10,19 +10,12 @@
pub struct Config {
pub(crate) hydrate: bool,
pub(crate) root: ConfigRoot,
pub(crate) cached_strings: Vec<String>,
pub(crate) default_panic_hook: bool,
}
impl Default for Config {
fn default() -> Self {
Self {
hydrate: false,
root: ConfigRoot::RootName("main".to_string()),
cached_strings: Vec::new(),
default_panic_hook: true,
}
}
pub(crate) enum ConfigRoot {
RootName(String),
RootElement(web_sys::Element),
}
impl Config {
@@ -72,7 +65,12 @@ impl Config {
}
}
pub(crate) enum ConfigRoot {
RootName(String),
RootElement(web_sys::Element),
impl Default for Config {
fn default() -> Self {
Self {
hydrate: false,
root: ConfigRoot::RootName("main".to_string()),
default_panic_hook: true,
}
}
}
+2 -3
View File
@@ -28,8 +28,7 @@ pub fn launch_virtual_dom(vdom: VirtualDom, platform_config: Config) {
});
}
///
/// Launch the web application with the given root component and config
pub fn launch_cfg(root: fn() -> Element, platform_config: Config) {
let mut vdom = VirtualDom::new(root);
launch_virtual_dom(vdom, platform_config);
launch_virtual_dom(VirtualDom::new(root), platform_config);
}