// Like Promise.all, but it does not mind if any of the promises reject.
export default function whenAllSettled(promises, {
    onRejection = err => {},
} = {}) {
    return Promise.all(
        promises.map(p => p.catch(onRejection))
    )
}

// Like Promise.all, but it does not mind if any of the promises reject.
export default function whenAllSettled(promises, {
    onRejection = err => {},
} = {}) {
    return Promise.all(
        promises.map(p => Promise.resolve(p).catch(onRejection))
    )
}

Fix whenAllSettled: tolerate non-promise elements.
Fix whenAllSettled: tolerate non-promise elements.
