The Greatest Candy and Event Delegation
Hey Folks,
It was a good spooky candy week, but let me submit to you, dear reader, that the greatest of all candies is largely absent from this week's candy hauls:
That's right. The humble Caramel Cream. Perfected over 100 years ago and still delivering today. I recommend you try it if you've never had one.
Thinking Too Hard
I had an issue this week where I have two technologies that don't talk to each other. My coworker suggested a technique I had seen before but never knew the name of. It's ... whispers ✨ event delegation ✨. Because the event bubbles up the DOM to the document
object, it doesn't matter whether one system knows about the other or not ... The DOM knows!
This is also great for closing patterns, like closing a dropdown if you click outside of it. You just invert it, instead of looking for that particular element in the event.target
you check to see if it's NOT there. The matches() and closest() methods work really well here.
Interesting Web Bits
- I Accidentally Saved Half A Million Dollars - just... oof.
- Julia Evans breaks down some confusing git terminology
- A neat halloween terminal game
- A dueling set of blog posts dropped recently on Why I Won’t Use Next.js and Why I’m Using Next.js Kent asserts Next.js is too magic, doesn't utilize the web platform, and is hard to deploy (anywhere but Vercel). Lee says Next DOES teach web platform, that it's fully functional self-hosted, and allows a developer to write everything in one go... 🍿🍿