UNPKG

@ksconsole/qiankun-plus

Version:

A completed implementation of Micro Frontends

19 lines 469 B
export function allSettledButCanBreak(promises, shouldBreakWhileError) { return Promise.all(promises.map(function (promise, i) { return promise.then(function (value) { return { status: 'fulfilled', value: value }; }).catch(function (reason) { if (shouldBreakWhileError && shouldBreakWhileError(i)) { throw reason; } return { status: 'rejected', reason: reason }; }); })); ; }