Skip to content

Instantly share code, notes, and snippets.

@adrianseeley
Created July 30, 2015 20:21
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 adrianseeley/b8ae836ec793e459d751 to your computer and use it in GitHub Desktop.
Save adrianseeley/b8ae836ec793e459d751 to your computer and use it in GitHub Desktop.
sample
// 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