3 ms·
It's certainly a leak. That setInterval is going to be holding the closure context alive which will reference the component in many frameworks. The setInterval
by bgirard 5y ago
It's certainly a leak. That setInterval is going to be holding the closure context alive which will reference the component in many frameworks.
The setInterval will also keep firing causing, wasting CPU and battery.
It's hard to take any examples here seriously without showing proper cleanup that would pass code review.
- sanitycheck 5y agoGood to see other people spotted that, I noticed it immediately and had a "there's a bug! a bug!" alarm bell ringing in my head throughout the rest of the article. I may have some sort of setInterval related PTSD.