since many people asked. i might write an eps 2 that could cover this.
Please do, if you haven't already. I enjoyed your article btw, pinned on reading list.
Currently, I have the following somewhat working:
render.ts if (events) { events.map(([type, event]) => { $element.addEventListener(type, event) }) }
index.ts attrs: {...}, events: [['click',() => {console.log('event handled')}]]
It seems to work and not to propagate upwards. Not sure about dynamically rendering nested elements or w/e. Thoughts?
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
since many people asked. i might write an eps 2 that could cover this.
Please do, if you haven't already. I enjoyed your article btw, pinned on reading list.
Currently, I have the following somewhat working:
render.ts
if (events) {
events.map(([type, event]) => {
$element.addEventListener(type, event)
})
}
index.ts
attrs: {...},
events: [['click',() => {console.log('event handled')}]]
It seems to work and not to propagate upwards. Not sure about dynamically rendering nested elements or w/e. Thoughts?