Skip to content

handleEvent for the win :) #126

@katywings

Description

@katywings

Hey dear friends!

Do you know about this? https://www.thecssninja.com/javascript/handleevent

I think it would be a nice addition if your eventhandling would accept objects like in vanilla js!

var app = {
  state: { title: 'Example' },
  handleEvent: function(evt) { ....
  render: function() {
     return h('button', { onclick: this })
  }
  ...
}
....

No bind is required when you use vanilla htmlButton.addEventListener('click', app)!

Thanks for your feedback in advance!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions