Trait js_utils::event::When

source ·
pub trait When: AsRef<EventTarget> + Sized {
    fn when<E: FromWasmAbi + 'static, F: FnMut(E) + 'static>(
        self: &Rc<Self>,
        event_type: &'static str,
        callback: F
    ) -> Result<EventListener<Self, E>, JsError>; }
Expand description

Trait for listening to events with a callback.

Required Methods§

Run callback when given event type occurs.

Implementors§