Enum virtual_node::event::ManagedEvent [−][src]
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.
Tuple Fields of Delegated
0: EventHandlerNonDelegated(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.
Tuple Fields of NonDelegated
0: EventHandler1: Rc<dyn AsRef<JsValue>>