Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for anonymous events #10

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Add support for anonymous events #10

wants to merge 3 commits into from

Conversation

tqwewe
Copy link
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