Skip to content

Commit

Permalink
Returning timeoutID and doing proper cleanup using clearTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
mfeineis committed Sep 11, 2018
1 parent 4240aab commit 454db4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Elm/Kernel/Browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ var _Browser_document = __Debugger_document || F4(function(impl, flagDecoder, de
var _Browser_cancelAnimationFrame =
typeof cancelAnimationFrame !== 'undefined'
? cancelAnimationFrame
: function() {};
: function(id) { clearTimeout(id); };

var _Browser_requestAnimationFrame =
typeof requestAnimationFrame !== 'undefined'
? requestAnimationFrame
: function(callback) { setTimeout(callback, 1000 / 60); };
: function(callback) { return setTimeout(callback, 1000 / 60); };


function _Browser_makeAnimator(model, draw)
Expand Down

0 comments on commit 454db4e

Please sign in to comment.