Quique Fdez. Guerra
1 min readDec 20, 2019

--

Old post, but I want to add an update (probably someone commented before).

I used this `asyncForEach` a lot of times but nowadays I’m starting to change it and create an array of promises.

const promises = [];

data.forEach(x => promises.push(strapi.services[serviceName].create(x)));
await Promise.all(promises);

thanks for the article :)

--

--

Quique Fdez. Guerra
Quique Fdez. Guerra

Written by Quique Fdez. Guerra

Director of Engineering at @PlainConcepts Romania Frontend Developer Lazy @Github contributor Happy @Helpdev_ founder Web @GoogleDevExpert

No responses yet