traxxx-web/utils/promise-props.js

6 lines
201 B
JavaScript

export default async function promiseProps(obj) {
const resolved = await Promise.all(Object.entries(obj).map(async ([key, promise]) => [key, await promise]));
return Object.fromEntries(resolved);
}