@hotmeshio/hotmesh
Version:
Serverless Workflow
16 lines (15 loc) • 541 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.all = void 0;
/**
* A workflow-safe version of Promise.all, currently limited to certain concurrency.
* @private
* @param {...Promise<T>[]} promises - An array of promises.
* @returns {Promise<T[]>} A promise resolving to an array of results.
*/
async function all(...promises) {
// a micro-delay to ensure correct sequencing
await new Promise((resolve) => setTimeout(resolve, 1));
return await Promise.all(promises);
}
exports.all = all;
;