This is a great article on what might seem like the simple act of removing event listeners from objects in #JavaScript. There are more options than just removeEventListener(). Particularly interesting, is using the AbortController.

https://www.macarthur.me/posts/options-for-removing-event-listeners

Then for more AbortController goodness, check out @samthor's posts: https://whistlr.info/2022/abortcontroller-is-your-friend/ and more recently https://whistlr.info/2023/abortcontroller-for-expiry/.

There's some very cool things you can use the AbortController for!

You’ve Got Options for Removing Event Listeners

Reviewing some of the most common approaches available to remove event listeners in JavaScript.

Alex MacArthur
@philnash @samthor I like the #AbortController approach, didnt know it could be used for other than cancelling #fetch #requests 👍🏼