Promise Conventions for Happier Developers

:construction: Name Promise Functions with getX()

Name Inline Functions with verbs

  • Improves readability and debugging
const getName = (dinosaur) => dinosaur.name
const log = (value) => console.log(value)
getDinosaur()
  .then(getName)
  .then(log)

:construction: Indent chained methods .then() .catch()

results matching ""

    No results matching ""