3 ms·
I used jQuery back in the day and I never used namespaces, so I had no idea what ns.click meant. I don't really see why it's a desirable feature now. It just se
by earthboundkid 5y ago
I used jQuery back in the day and I never used namespaces, so I had no idea what ns.click meant. I don't really see why it's a desirable feature now. It just seems like a weird artifact of the fact that jQuery predates CustomEvents. I mean, I guess if there were no CustomEvents, it would be useful, but they exist now, so just use them.
- fabiospampinato 5y agoFor the record the code you linked to doesn't implement event delegation either, which is something pretty useful that even more modern libraries like React use under the hood. Here's [0] an article about the usefulness of namespaces, it has use cases beyond custom events, which have been implemented a real long time ago. [0]: https://css-tricks.com/namespaced-events-jquery/ https://css-tricks.com/namespaced-events-jquery/