Skip to content

Instantly share code, notes, and snippets.

@mmazer
Created September 24, 2012 01:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmazer/3773787 to your computer and use it in GitHub Desktop.
Save mmazer/3773787 to your computer and use it in GitHub Desktop.
JavaScript: Simple function queue
// http://webreflection.blogspot.ca/2012/03/tweet-sized-queue-system.html
function Queue(args, f) {
setTimeout(args.next = function next() {
return (f = args.shift()) ? !!f(args) || !0 : !1;
}, 0);
return args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment