I want to run a loop parralel. What is the best practise to handle this? At this moment it is not working parralel, so it takes over sometimes 3 seconds before the fields have been proceeded by the default loop. Below my current example;
const getData = async (method, componentDispatch, componentFields, pageNumber = 1) => {
// It is necessary to wait for this call.
await store.dispatch(Actions[componentDispatch], componentInit.value.currentId).then(async () => {
const fields = JSON.parse(componentFields);
// I want to create a loop here which does NOT wait on each other, as in this loop there are other async functions, I want to run this loop next to each other on the same time.
for (let i = 0; i < fields.length; i++) {
const test = await hello();
}
})
}