polish: clean up the core crate

This commit is contained in:
Jonathan Kelley committed 2021-12-12 19:47:13 -05:00
1 parent 1e4a599d14
commit e6c6bbdc1e
15 files changed
+760 -434

No files matched your search

+10
View File
@@ -11,6 +11,7 @@
pub struct WebConfig {
pub(crate) hydrate: bool,
pub(crate) rootname: String,
pub(crate) cached_strings: Vec<String>,
}
impl Default for WebConfig {
@@ -18,6 +19,7 @@ impl Default for WebConfig {
Self {
hydrate: false,
rootname: "main".to_string(),
cached_strings: Vec::new(),
}
}
}
@@ -41,4 +43,12 @@ impl WebConfig {
self.rootname = name.into();
self
}
/// Set the name of the element that Dioxus will use as the root.
///
/// This is akint to calling React.render() on the element with the specified name.
pub fn with_string_cache(mut self, cache: Vec<String>) -> Self {
self.cached_strings = cache;
self
}
}