Skip to content

Instantly share code, notes, and snippets.

@alivesay
Created June 24, 2015 02:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alivesay/2ec337ef688f45c74ee6 to your computer and use it in GitHub Desktop.
Save alivesay/2ec337ef688f45c74ee6 to your computer and use it in GitHub Desktop.
promiseToCallback
function promiseToCallback(promise, callback) {
promise
.then(function (result) {
return callback(null, result);
})
.catch(function (err) {
return callback(err, null);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment