Created
January 14, 2013 05:59
-
-
Save drhayes/4528006 to your computer and use it in GitHub Desktop.
EventChain: The Basics
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
// Defines a function that can fire sequential events. | |
EventChain = function() { | |
// Make sure we get called with new. | |
if (this === window) { | |
return new EventChain(); | |
} | |
var steps = []; | |
// Called every frame. | |
var update = function() { | |
if (steps && steps.length) { | |
steps[0](); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment