lundi 27 juin 2016

Multiple Promise.all() because multiple arrays

I have an array of objects, each object has some properties, each property contains an url of an image.

I have more arrays, and I want download all these images, so I use fetch() promise. Promise.all() accepts an array of promises, so I run Promise.all() for each property, since I don't want to have an array with all the promise for all the properties.

But.. do I have to write all of them manually? I know I can't use for loops. Or do I have to use recursion (if it is possible in this case), each time calling a function from the inside with a new array?

Aucun commentaire:

Enregistrer un commentaire