Skip to content

Instantly share code, notes, and snippets.

@shawnbot
Created February 12, 2015 23:49
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 shawnbot/02d14fd2034998b4aa31 to your computer and use it in GitHub Desktop.
Save shawnbot/02d14fd2034998b4aa31 to your computer and use it in GitHub Desktop.
asyncdammit
function noreallygimmeasyncdammit(sync) {
return function() {
var args = [].slice.call(arguments),
next = args.pop();
try {
var value = sync.apply(this, args);
} catch (err) {
return next(err);
}
next(null, value);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment