I've been doing exactly that in my more recent projects, and it works extremely well for simpler views/shallow DOMS.
But it turns into write-only code pretty fast when you have tons of callbacks flying around for highly interactive elements.
But it turns into write-only code pretty fast when you have tons of callbacks flying around for highly interactive elements.
For everything else, you can use data-binding. If you're already writing lexically scoped render functions, you can trivially create a data-bindable local object in a variable to eliminate the event management process. Instead of an onclick event for a checkbox, you can trivially set the checked property to be equal to an observable value box containing a boolean. With the right abstractions, callback spaghetti is not an issue.