-
-
Save adrianseeley/b8ae836ec793e459d751 to your computer and use it in GitHub Desktop.
sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// my suggested pattern | |
tradeOffers.getOffers(getOffersOpts, function (err, offers) { | |
if (err) { | |
return console.error(err); | |
} | |
console.log('Offers:', offers); | |
}); | |
// the original | |
// Used as a promise | |
tradeOffers.getOffers(getOffersOpts) | |
.then(function (offers) { | |
console.log('Offers:', offers); | |
}) | |
.catch(function (err) { | |
console.error(err); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment