Skip to content

Commit

Permalink
Using wrappers for window.{cancel,request}AnimationFrame
Browse files Browse the repository at this point in the history
  • Loading branch information
mfeineis committed Sep 10, 2018
1 parent 3b02034 commit 4240aab
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Elm/Kernel/Browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ var _Browser_document = __Debugger_document || F4(function(impl, flagDecoder, de
// ANIMATION


var _Browser_cancelAnimationFrame =
typeof cancelAnimationFrame !== 'undefined'
? cancelAnimationFrame
: function() {};

var _Browser_requestAnimationFrame =
typeof requestAnimationFrame !== 'undefined'
? requestAnimationFrame
Expand Down Expand Up @@ -261,12 +266,12 @@ function _Browser_rAF()
{
return __Scheduler_binding(function(callback)
{
var id = requestAnimationFrame(function() {
var id = _Browser_requestAnimationFrame(function() {
callback(__Scheduler_succeed(Date.now()));
});

return function() {
cancelAnimationFrame(id);
_Browser_cancelAnimationFrame(id);
};
});
}
Expand Down

0 comments on commit 4240aab

Please sign in to comment.