Is the following code constructing the "shared" object in a correct way?
const shared = {};
const createUniqueField = async (value) => {
shared[value] = await getDataFromSomeService(value);
};
await Promise.all(someArrayWithUniqueValues.map(value => createUniqueField(value)));
If not, what are the alternatives to do that?