Last active
February 11, 2018 17:15
-
-
Save WebReflection/574ae00d82c97b36176355fa070c036b to your computer and use it in GitHub Desktop.
Grants UI setup and future state through rAF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var paint = function(rAF){ 'use strict'; | |
return function paint(before) { | |
before(); | |
return rAF(before), { | |
then: function (after) { | |
return rAF(rAF.bind(null, after)), this; | |
} | |
}; | |
}; | |
}( | |
self.requestAnimationFrame || | |
self.webkitRequestAnimationFrame || | |
self.mozRequestAnimationFrame || | |
self.oRequestAnimationFrame || | |
self.msRequestAnimationFrame || | |
function(fn) { setTimeout(fn, 1000 / 60); } | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
example