pub enum ManagedEvent {
    Delegated(EventHandler),
    NonDelegated(EventHandlerRc<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(EventHandlerRc<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

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.