mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-22 17:58:05 +00:00
* Upgrade linting to 2.0.0-0 * Adjust so we can pass without error * Fix linting * Update header-blacklist.js * Update index.js * Update Uppy.js * Update Components.js * Update StatusBar.js * Update Assembly.js * Upgrade to linting 2.0.0 (final release)
21 lines
427 B
JavaScript
21 lines
427 B
JavaScript
module.exports = function settle (promises) {
|
|
const resolutions = []
|
|
const rejections = []
|
|
function resolved (value) {
|
|
resolutions.push(value)
|
|
}
|
|
function rejected (error) {
|
|
rejections.push(error)
|
|
}
|
|
|
|
const wait = Promise.all(
|
|
promises.map((promise) => promise.then(resolved, rejected)),
|
|
)
|
|
|
|
return wait.then(() => {
|
|
return {
|
|
successful: resolutions,
|
|
failed: rejections,
|
|
}
|
|
})
|
|
}
|