Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Yes, adding addEventListener code all over your app would be repetitive and wasteful, but that (amongst browser incompatibilities) is why jQuery was invented, but you can hand roll your own utility or use HTMX or a million concise tools to do this. Including a right-sized dependency isn’t going to kill you.

This article is explicitly a defense of the interface that htmx (which I am a core maintainer for) employs. I think more JS libraries should use attributes as their interface. As for when and where that's appropriate, well, like anything, it depends on the context, but I'm confident in saying it's appropriate in more contexts than it is currently being used.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: