fix hot reloading

This commit is contained in:
Evan Almloff committed 2023-10-04 09:11:21 -05:00
1 parent ed95ac932d
commit 7f0fa07757
3 files changed
+16 -3

No files matched your search

-2
View File
@@ -1,5 +1,3 @@
use dioxus::prelude::*;
#[test]
fn rsx() {
let t = trybuild::TestCases::new();
@@ -15,6 +15,7 @@ use serde::{de::DeserializeOwned, Serialize};
/// let state1 = use_state(cx, || from_server(|| {
/// 1234
/// }));
/// todo!()
/// }
/// ```
pub fn server_cached<O: 'static + Serialize + DeserializeOwned>(server_fn: impl Fn() -> O) -> O {
+15 -1
View File
@@ -37,12 +37,26 @@ impl ToTokens for AttributeType {
}
}
#[derive(PartialEq, Eq, Clone, Debug, Hash)]
#[derive(Clone, Debug)]
pub struct ElementAttrNamed {
pub el_name: ElementName,
pub attr: ElementAttr,
}
impl Hash for ElementAttrNamed {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
self.attr.name.hash(state);
}
}
impl PartialEq for ElementAttrNamed {
fn eq(&self, other: &Self) -> bool {
self.attr == other.attr
}
}
impl Eq for ElementAttrNamed {}
impl ElementAttrNamed {
pub(crate) fn try_combine(&self, other: &Self) -> Option<Self> {
if self.el_name == other.el_name && self.attr.name == other.attr.name {