MDN does a fairly good job of covering the lifecycle events for web components but one in particular got my attention today, disconnectedcallback. As kind of the inverse of connectedCallback, it will be fired when an instance of your custom element is removed from the DOM. While I didn't doubt this worked as advertised, I wanted to build a quick demo myself so I could see it in action. Let's start off with a component that demonstrates why this event is needed.