GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
My use-case is an activity feed with only 5 items. However, over the lifetime of the web application, thousands of items pass through the feed.
It was not ideal to have thousands of setInterval calls fire each minute.
setInterval will clear itself when element removed
setInterval will clear itself when element is removed from the DOM.
Updated to deal with multiple elements.
Credit to tangphillip.
Changed Function.call to refresh.call
Any word on this issue? Single page apps are becoming more common and timeago needs the ability to remove itself.