Skip to content

Instantly share code, notes, and snippets.

@alexspurling
Forked from sukima/function_juggling.coffee
Last active December 21, 2015 11:18
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 alexspurling/6297655 to your computer and use it in GitHub Desktop.
Save alexspurling/6297655 to your computer and use it in GitHub Desktop.
Umm...
get = -> {
secret_callback = -> {
secret_squirrly_function = -> {secret_callback(err, res, body)}
# Do something asynchronous
setTimeout secret_squirrly_function, 5000
# and return a function
(callback) -> {secret_callback = callback}
}
}
get()(err, res, body) -> {
console.log "Done!"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment