Closed
Description
Describe the problem
While reviewing #11271, I noticed that we're calling addEventListener
for certain bindings without an accompanying removeEventListener
. At first I thought we should probably add the removeEventListener
, but then it occurred to me that the event listeners exist for the full lifetime of the element — after it gets removed from the DOM, it should be GC'd along with its event handlers.
Is that true though? Is it safe not to remove event listeners?
Describe the proposed solution
We should do one of two things:
- Remove event listeners, if we do in fact need to
- More likely, we can remove some redundant
removeEventListener
calls, making the library a tiny bit leaner
Importance
nice to have
Metadata
Metadata
Assignees
Labels
No labels