fix subscriptions in events

This commit is contained in:
Evan Almloff committed 2023-08-04 17:23:57 -07:00
1 parent 07ed3e67dd
commit a6f611eccf
12 files changed
+445 -103

No files matched your search

+2 -4
View File
@@ -1,4 +1,4 @@
use crate::{
use crate::prelude::EventHandler;use crate::{
any_props::AnyProps, arena::ElementId, Element, Event, LazyNodes, ScopeId, ScopeState,
};
use bumpalo::boxed::Box as BumpBox;
@@ -476,7 +476,7 @@ pub enum AttributeValue<'a> {
Bool(bool),
/// A listener, like "onclick"
Listener(RefCell<Option<ListenerCb<'a>>>),
Listener(EventHandler<'a, Event<dyn Any>>),
/// An arbitrary value that implements PartialEq and is static
Any(RefCell<Option<BumpBox<'a, dyn AnyValue>>>),
@@ -485,8 +485,6 @@ pub enum AttributeValue<'a> {
None,
}
pub type ListenerCb<'a> = BumpBox<'a, dyn FnMut(Event<dyn Any>) + 'a>;
/// Any of the built-in values that the Dioxus VirtualDom supports as dynamic attributes on elements that are borrowed
///
/// These varients are used to communicate what the value of an attribute is that needs to be updated