Skip to content

Instantly share code, notes, and snippets.

@michiel
Created May 17, 2011 13:33
Show Gist options
  • Select an option

  • Save michiel/976470 to your computer and use it in GitHub Desktop.

Select an option

Save michiel/976470 to your computer and use it in GitHub Desktop.
Sequencer in coffeescript
sequence = (arr) ->
self = ->
if arr.length then arr.shift() self
self()
async = (callback) ->
console.log "Calling callback after 1s"
setTimeout callback, 1000
sequence [async, async, async]
@michiel

michiel commented May 23, 2011

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment