Enum virtual_node::event::ManagedEvent
source · [−]pub enum ManagedEvent {
Delegated(EventHandler),
NonDelegated(EventHandler, Rc<dyn AsRef<JsValue>>),
}Expand description
An event that to be managed by the PercyDom.
Variants
Delegated(EventHandler)
Every kind of delegated event, such as onclick, has a single event listener attached to the PercyDom’s mount. When that listener is called, it looks up the proper ManagedEvent::Delegated event to call.
NonDelegated(EventHandler, Rc<dyn AsRef<JsValue>>)
For non delegated events, an event listener is attached to the DOM element using
.add_event_listener();
That event listener is an EventWrapper, which in turn will find and call the
EventAttribFn.
This setup allows us to replace the EventAttribFn after every render without needing
to re-attach event listeners.
Auto Trait Implementations
impl !RefUnwindSafe for ManagedEvent
impl !Send for ManagedEvent
impl !Sync for ManagedEvent
impl Unpin for ManagedEvent
impl !UnwindSafe for ManagedEvent
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more