pileup.js icon indicating copy to clipboard operation
pileup.js copied to clipboard

Use ES6 promises

Open danvk opened this issue 10 years ago • 1 comments

I suspect Flow will understand them better than it understands Q.

danvk avatar Nov 12 '15 15:11 danvk

Cheat sheet:

  • Q.when(x)Promise.resolve(x)
  • Q.reject(x)Promise.reject(x)
  • Q.all([p1, p2, ...])Promise.all([p1, p2, ....])

For Q.defer(), there's promise-defer.

Conveying progress (.notify()), there is no ES6 equivalent. Unfortunately, this may be a deal-breaker. We use promise notifications to indicate how many BAM requests have been made, for example.

danvk avatar Nov 12 '15 16:11 danvk