Hacker News new | ask | show | jobs
by edwinvdgraaf 4698 days ago
RequestAnimationFrame[1] would solve that, however it wouldn't trigger in the background, which may, or may not be wanted.

[1]: http://www.paulirish.com/2011/requestanimationframe-for-smar...

2 comments

Probably is actually, I'd expect there's little need to update the list if said list is not being looked at. On the other hand, it might be fairly costly while the system is being watched as it will fire (and do some check) on every single frame.
requestAnimationFrame may be too frequent in the foreground (could effect performance?), and not necessarily 0 in the background.

That repaint may occur up to 60 times per second for foreground tabs (the exact rate is up to the browser to decide), but may be reduced to a lower rate in background tabs.

https://developer.mozilla.org/en-US/docs/Web/API/window.requ...