I am trying to create a Promise.all with an array of items. So if I create it like this it works fine
Promise.all([
Query.getStuff(items[0]),
Query.getStuff(items[1])
]).then(result => console.log(result))
If I try to create the Promise.all like this, it doesn't work
Promise.all([
items.map(item => Query.getStuff(item))
]).then(result => console.log(result))
The then block is run before the Query.getStuff(item). What am I missing?