chrisdickinson / raf

requestAnimationFrame polyfill library
MIT License
742 stars 54 forks source link

Fixed `resume` #6

Closed CMTegner closed 11 years ago

CMTegner commented 11 years ago

Invoking pause didn't actually pause the event stream, it stopped the entire RAF loop. In other words, calling resume on a paused stream had no effect. The fix was to place emit inside the paused check, and move _raf out.

I'm not sure if you're satisfied with this solution, or if you'd rather just restart the raf-loop on resume. Let me know and I'll update the PR.