KyleAMathews / element-resize-event

Library to make it easy to listen for element resize events
http://kyleamathews.github.io/element-resize-event/
MIT License
175 stars 44 forks source link

make sure that trigger exists before calling listeners on it #24

Closed JLarky closed 6 years ago

JLarky commented 7 years ago

Howdy. I have code that creates and removes elements very rapidly, so that when it's time for requestAnimationFrame original element was already deleted. All of my callbacks are accounting for that, but internally requestFrame crashes like that: image and this simple check seem to be enough to fix the crash

eaglus commented 6 years ago

Fixed here: https://github.com/KyleAMathews/element-resize-event/commit/f1af380d465028a7ca26fc78f87ba0d6cc0ea593