submillisecond-live-view icon indicating copy to clipboard operation
submillisecond-live-view copied to clipboard

Add support for anonymous events

Open tqwewe opened this issue 2 years ago • 0 comments

Adds support for anonymous events, where the handler is inlined in the html.

html! {
    button @click=(|state| state.count += 1) { "Increment" }
}

Upsides:

  • Reduces boilerplate for simple events

Downsides:

  • Rendered now has a generic
  • VSCode intellisense doesn't seem to work in the callbacks
  • Cannot manually trigger this event from the server
  • Might be harder to debug, since the generated event name is random

tqwewe avatar Nov 21 '22 08:11 tqwewe