Skip to content

Instantly share code, notes, and snippets.

@CarlMungazi
Created November 18, 2019 20:10
Show Gist options
  • Save CarlMungazi/0f37b55017a6fcdc343cecf92b01867d to your computer and use it in GitHub Desktop.
Save CarlMungazi/0f37b55017a6fcdc343cecf92b01867d to your computer and use it in GitHub Desktop.
function updateEvent(vnode, key, value) {
if (vnode.events != null) {
if (vnode.events[key] === value) return
if (value != null && (typeof value === "function" || typeof value === "object")) {
if (vnode.events[key] == null) vnode.dom.addEventListener(key.slice(2), vnode.events, false)
vnode.events[key] = value
}
// ...
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment