Skip to content

Instantly share code, notes, and snippets.

@drhayes
Created January 14, 2013 05:59
Show Gist options
  • Save drhayes/4528006 to your computer and use it in GitHub Desktop.
Save drhayes/4528006 to your computer and use it in GitHub Desktop.
EventChain: The Basics
// 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