Make EventHandler copy (#2112)
* implement Copy for EventHandler * implement from closure for event handler and remove special on prefix * fix props implementation of EventHandler
This commit is contained in:
1 parent
4bb807a3ce
commit
58f7efafea
19 files changed
+755
-364
No files matched your search
@@ -1,3 +1,4 @@
|
||||
use crate::read_impls;
|
||||
use crate::{read::Readable, Memo, ReadableRef};
|
||||
use dioxus_core::prelude::ScopeId;
|
||||
use generational_box::UnsyncStorage;
|
||||
@@ -68,12 +69,6 @@ impl<T: PartialEq + 'static> Readable for GlobalMemo<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: PartialEq + 'static> PartialEq for GlobalMemo<T> {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
std::ptr::eq(self, other)
|
||||
}
|
||||
}
|
||||
|
||||
/// Allow calling a signal with memo() syntax
|
||||
///
|
||||
/// Currently only limited to copy types, though could probably specialize for string/arc/rc
|
||||
@@ -84,3 +79,5 @@ impl<T: PartialEq + Clone + 'static> Deref for GlobalMemo<T> {
|
||||
Readable::deref_impl(self)
|
||||
}
|
||||
}
|
||||
|
||||
read_impls!(GlobalMemo<T> where T: PartialEq);
|
||||
Reference in new issue
Block a user