Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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?


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...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: