elm-lang/animation-frame/1.0.1

NOTE: this package moved to elm/browser

NOTE: this package is not compatible with Elm 0.19.1

AnimationFrame

Browsers have their own render loop, repainting things as fast as possible. If you want smooth animations in your application, it is helpful to sync up with the browsers natural refresh rate. The subscriptions in this library fire in step with the browser so you can make sure you are not doing extra animation frames.

Note: The subscriptions in this library hook into JavaScript's requestAnimationFrame function.

Animation Subscriptions

times : (Time -> msg) -> Sub msg

Subscribe to the current time, given in lockstep with the browser's natural rerender speed.

diffs : (Time -> msg) -> Sub msg

Subscribe to the time diffs between animation frames, given in lockstep with the browser's natural rerender speed.