Skip to content

Instantly share code, notes, and snippets.

@fariszacina
Last active November 4, 2015 10:45
Show Gist options
  • Select an option

  • Save fariszacina/2ff9cad934ca3ddcf2f1 to your computer and use it in GitHub Desktop.

Select an option

Save fariszacina/2ff9cad934ca3ddcf2f1 to your computer and use it in GitHub Desktop.
Promise Pyramid of Doom - Resolved
export function bookApartment(req, res, next) {
booking
.create(req.booking)
.then((data) => notifier.sendBookingConfirmation(data))
.then((result) => statistics.log(result))
.then(() => log.debug('booking-succeeded'))
.then(() => res.send(200))
.catch((err) => next(err))
.done();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment