Latest Posts

I write about front-end web development. I'm inspired by Nathan Barry's motto, teach everything you know. I also take a lot of inspiration from my friend and mentor, Chris Ferdinandi.

How I use event delegation with Reef

In my last post, I wrote about my preferred approach for event delegation. I like to attach my event listeners as close as possible to the target elements. Here’s how I do that in Reef, a small library my friend Chris Ferdinandi created. It lets you create reactive, state-based components with much less overhead than the big frameworks like React.

My approach to event delegation

Event delegation is an easier and more performant way to add event listeners in JavaScript. You attach the listener to a common ancestor and allow the event to “bubble” up through the DOM tree.

Why use JSX when you can use template literals?

Yesterday, I wrote about my favourite ES6 features. Template literals take the top spot. I think they make JSX, the JavaScript syntax extension React uses, largely pointless.