UNPKG

@ksconsole/qiankun-plus

Version:

A completed implementation of Micro Frontends

25 lines (24 loc) 597 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.allSettledButCanBreak = allSettledButCanBreak; 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 }; }); })); ; }