furrary / react-fiber-demo

React Fiber Demo
https://furrary.github.io/react-fiber-demo/
MIT License
20 stars 3 forks source link

Replace Time.every with AnimationFrame #3

Closed rl-king closed 6 years ago

rl-king commented 6 years ago

Use browser's native render hook. As described at http://package.elm-lang.org/packages/elm-lang/core/5.1.1/Time#every Time.every is not the ideal way to achieve smooth animations. The AnimationFrame package provides a hook to the browser's requestAnimationFrame function.

furrary commented 6 years ago

When I read the docs, I thought that I need JS Interop to achieve this. Thanks for the PR.

rl-king commented 6 years ago

Ah yea, I can see why, it's not very clear from those docs.