pileup.js
pileup.js copied to clipboard
Use ES6 promises
I suspect Flow will understand them better than it understands Q.
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.