fn add_event_listener< T, F >( &self, listener: F ) -> EventListenerHandle
        where T: ConcreteEvent, F: FnMut( T ) + 'static
    {
        let reference = self.as_ref();
        let listener_reference = js! {
            var listener = @{listener};
            @{reference}.addEventListener( @{T::EVENT_TYPE}, listener );
            return listener;
        }.try_into().unwrap();

        EventListenerHandle {
            event_type: T::EVENT_TYPE,
            reference: reference.clone(),
            listener_reference: listener_reference
        }
    }
/// Adds given event handler to the list the list of event listeners for
/// the specified `EventTarget` on which it's called.
///
/// [(JavaScript docs)](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener)
Adds given event handler to the list the list of event listeners for
the specified `EventTarget` on which it's called.


Adds given event handler to the list the list of event listeners for the specified ` EventTarget ` on which it ' s called .
fn add_event_listener< T, F >( &self, listener: F ) -> EventListenerHandle
        where T: ConcreteEvent, F: FnMut( T ) + 'static
    {
        let reference = self.as_ref();
        let listener_reference = js! {
            var listener = @{listener};
            @{reference}.addEventListener( @{T::EVENT_TYPE}, listener );
            return listener;
        }.try_into().unwrap();
        EventListenerHandle {
            event_type: T::EVENT_TYPE,
            reference: reference.clone(),
            listener_reference: listener_reference
        }
    }
fn add_event_listener < T , F > ( & self , listener : F ) -> EventListenerHandle where T : ConcreteEvent , F : FnMut ( T ) + ' static { let reference = self . as_ref ( ) ; let listener_reference = js ! { var listener { listener } { reference } addEventListener ( { T EVENT_TYPE } listener ) return listener } . try_into ( ) . unwrap ( ) ; EventListenerHandle { event_type : T :: EVENT_TYPE , reference : reference . clone ( ) , listener_reference : listener_reference } }
Adds given event handler to the list the list of event listeners for
the specified `EventTarget` on which it's called.
Adds given event handler to the list the list of event listeners for the specified ` EventTarget ` on which it ' s called .
&self
listener
F
&self
listener
F