Created
April 29, 2015 10:45
-
-
Save beatobongco/739be299da08540b0eac to your computer and use it in GitHub Desktop.
Useful for queueing animations
This file contains hidden or 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
function Queue() { | |
this._sleep = 0 | |
this.add = function(f, sleep) { | |
this._sleep += sleep | |
setTimeout(function(){ | |
f() | |
}, this._sleep) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment