Software Unscripted cover image

React Hooks Design Review

Software Unscripted

CHAPTER

How to Clean Up Event Listeners in JavaScript

I can see an argument for forgetting to clean up event listeners is error prone or can be. So you want to ideally sort of abstract out of way and I guess that's what use like the hook kind of does is gives you both the here it is and then also here's the cleanup for it. But if I'm thinking about this, right? It feels like there's some way to do this with like prototypes maybe or some sort of class based thing. Maybe not. Oh, you mean like extending other components, maybe like creating some kind of inheritance. I'm just talking about plain old JavaScript inheritance.

00:00
Transcript
Play full episode

Remember Everything You Learn from Podcasts

Save insights instantly, chat with episodes, and build lasting knowledge - all powered by AI.
App store bannerPlay store banner