Hacker News new | ask | show | jobs
by mxtopher 4147 days ago
so tick calls requestAnimationFrame that calls tick that... Doesn't it create an ever growing stack? Isn't there a way to do it with a while loop?
2 comments

requestAnimationFrame just queues up the callback for later, it doesn't actually call into it. There's no stack growth.
It doesn't create an ever-growing stack.

tick calls requestAnimationFrame, tick returns, the browser waits for the next frame and calls tick...