maciejhirsz / kobold

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

`do` keyword as an alias to the `event!` macro #93

Closed maciejhirsz closed 3 months ago

maciejhirsz commented 3 months ago

Really concise inline event handlers:

view! {
    // No sugar:
    <input onclick={event!(state.foo = 42)}>

    // Equivalent using the `do` keyword:
    <input onclick={do state.foo = 42}>
}