Skip to content

Instantly share code, notes, and snippets.

@rippinrobr
Created October 30, 2018 00:39
Show Gist options
  • Save rippinrobr/6a51e079070f9afb378d37ee4cb52120 to your computer and use it in GitHub Desktop.
Save rippinrobr/6a51e079070f9afb378d37ee4cb52120 to your computer and use it in GitHub Desktop.
The rust function that is used in the index.js file to handle the clicks on the JS click button
// js_click_event_handler is called by the js code in a more
// 'tradiitional event listerner approach. It will popup an
// alert dialog and display the click event information
#[wasm_bindgen]
pub fn js_click_event_handler(evt: web_sys::MouseEvent) {
super::alert(&format!("[js handler]\n{:#?}", Click::new(evt)));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment