Skip to content

Add support for anonymous events#10

Draft
tqwewe wants to merge 3 commits into
mainfrom
anonymous-events
Draft

Add support for anonymous events#10
tqwewe wants to merge 3 commits into
mainfrom
anonymous-events

Conversation

@tqwewe
Copy link
Copy Markdown
Member

@tqwewe tqwewe commented Nov 21, 2022

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 tqwewe marked this pull request as draft November 21, 2022 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant