UNPKG

@metamodern/svelte-render

Version:

A friendly Jamstack-focused build tool for Svelte apps

13 lines (10 loc) 299 B
/* eslint no-unused-vars: off */ export const runParallel = async (tasks) => { const names = tasks.map(([n]) => n); const promises = tasks.map(([_, f]) => f()); const results = await Promise.all(promises); return names.reduce( (a, c, i) => a.set(c, results[i]), new Map(), ); };