I want to execute my code in the following order:
I know it's an old thread, but isn't
() => {return Promise.all([getPromise2(), getPromise3()]);}
a little superfluous? The idea of fat arrow is that you can write it as:
() => Promise.all([getPromise2(), getPromise3()])
which makes the resulting code somewhat clearer:
getPromise1().then(() => Promise.all([getPromise2(), getPromise3()]))
.then((args) => console.log(args)); // result from 2 and 3
Anyway, thanks for the answer, I was stuck with this :)
Just return Promise.all(...
getPromise1().then(() => {
return Promise.all([getPromise2(), getPromise3()]);
}).then((args) => console.log(args)); // result from 2 and 3