Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return map;
}, {});
return [mapping, data.InvalidParameters];
})
.catch(err => {
console.error('Something went wrong while fetching parameters', err);
dispatch({
type: FETCH_PARAMETER_VALUES_FAILURE,
payload: names
});
})
); // end of chunk calls
return pAll(getParameterRequestActions, { concurrency: 2 }).then(
bulkResults => {
// res will be a list of [mapping, invalidParameters]
const nameValueMapping = bulkResults.reduce(
(map, r) => ({ ...map, ...r[0] }),
{}
);
dispatch({
type: FETCH_PARAMETER_VALUES_SUCCESS,
payload: { names: Object.keys(nameValueMapping), nameValueMapping }
});
const invalidParameters = bulkResults.reduce(
(lst, r) => [...lst, ...r[1]],
[]
);