Thanks for the suggestion. I left in all those extra async awaits to show these functions return promises. Otherwise, I simply remove async and await if the function returns a promise.
Sure but I talk about the explicit the await, not the async part.
And here is a nice part of async functions:
They results always in a Promise, so you don't have to care about the return statement.
At least with the Promise/await part.
So what i mean
constusersData=awaitPromise.all(IDs.map(async(id)=>getUserData(id))// returns always a promise, no gain to write also await.);
Thanks for the suggestion. I left in all those extra async awaits to show these functions return promises. Otherwise, I simply remove async and await if the function returns a promise.
Sure but I talk about the explicit the await, not the async part.
And here is a nice part of async functions:
They results always in a Promise, so you don't have to care about the return statement.
At least with the Promise/await part.
So what i mean
There is even a eslint rule for that:
eslint.org/docs/rules/no-return-await
I think they explain the benefits and tradeoffs better than me :)