Both cases are pretty much equivalent. Wasm can't directly call javascript functions that accept functions, so wasm-bindgen has to create a wrapper javascript function to handle registering the event handler and calling back into rust. Manually writing this wrapper could be a bit more efficient I guess.