Struct consecuit_html::callback::Callback [−][src]
pub struct Callback<E: FromWasmAbi + 'static>(_);
Expand description
A callback for HTML attributes like onclick
, oninput
, etc.
Create one with Callback::new
, and pass it to the prop builder. Like this:
let click_handler = Callback::new(move |ev: web_sys::MouseEvent| { web_sys::console::log_1( &"You clicked the button!".into() ); }); cc_tree!( <button {html_props().onclick(click_handler)}>"click me!"</button> )
Implementations
Trait Implementations
Auto Trait Implementations
impl<E> !RefUnwindSafe for Callback<E>
impl<E> !UnwindSafe for Callback<E>
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self