Skip to content

Instantly share code, notes, and snippets.

@hughfdjackson
Created April 21, 2012 00:32
Show Gist options
  • Select an option

  • Save hughfdjackson/2432860 to your computer and use it in GitHub Desktop.

Select an option

Save hughfdjackson/2432860 to your computer and use it in GitHub Desktop.
Cute CPS
var after = function(fn, cb){
return function(){
fn.apply(this, arguments)
cb()
}
}
var fn = after(function(){ /* handle callback here */ }, function(){ /* setup next here */ })
// this API sucks. :p what a fail.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment