I have a couple of async functions that get and store a value if it has not already been provided.
if (!output.valueA) {
output.valueA = await getValueA();
}
if (!output.valueB) {
output.valueB = await getValueB();
}
I know I can use Promise.all() to wait for both of these calls asynchronously, but what would be the best way to do this while not knowing whether one or other, or both calls, are even required, and then storing the results in the correct variables?