maciejhirsz / kobold

Easy declarative web interfaces.
https://docs.rs/kobold/
Mozilla Public License 2.0
385 stars 7 forks source link

Make bound event listeners `Copy` #85

Closed maciejhirsz closed 1 year ago

maciejhirsz commented 1 year ago

This should now be legal:

bind! {
    state:

    let reset = |_| *state = 0;
}

view! {
    // `reset` previously was of `impl Listener<_>` type that made it `!Copy`
    <input onclick={reset} onchange={reset}>
}