In practical use, when would you be removing event listeners?
I feel like when you recycle elements, like an infinite list, event delegation should be used instead to prevent closure allocations.
And in the normal case, you just drop the element and its listeners get garbage collected with it.
There's probably a time to use this, but it's slipping my mind at the moment. Maybe something with scroll/draggables?
Also non-UI EventEmitters of course.
Also, manor should probably be manner
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
In practical use, when would you be removing event listeners?
I feel like when you recycle elements, like an infinite list, event delegation should be used instead to prevent closure allocations.
And in the normal case, you just drop the element and its listeners get garbage collected with it.
There's probably a time to use this, but it's slipping my mind at the moment. Maybe something with scroll/draggables?
Also non-UI
EventEmitter
s of course.Also, manor should probably be manner