I've got some code right now that looks like this:
const a = await function1();
const b = await function2();
const c = await function3();
However I'm trying to optimise for speed and don't want the delays. I have tried doing the following
[const a, const b, const c] = await Promise.all([function1, function2, function3)]
This works fine however the problem I then have is that I can't preserve the order of the calls initiated from my machine. As I send out a nonce on each request the end server will decline the request if it goes in order 1 -> 3 -> 2 instead of 1->2->3.
Is there a way to use the Promise.all which doesn't wait for each function to complete but still retain the order of the calls?