[][src]Function sauron_native::event::on

pub fn on<C, EVENT, MSG>(name: &'static str, c: C) -> Attribute<EVENT, MSG> where
    C: Into<Callback<EVENT, MSG>>, 

Creates a callback object from the function closure This will then be attached to the browser and emitted when that event is triggered.

FIXME: callbacks are recrated eveytime, therefore they are not equivalent when compared since function contents can not be compared. Only Rc's are compared.