Well, you are not wrong because this is pretty much a personal preference.
I just do not agree with you. 😎
Hiding async code with syntax sugar
It's not hiding, it's making it clear that it is async.
with async/await you have to wrap stuff in a try/catch
Only if you can handle the error and know what to do, otherwise it is better to let it bubble up.
Lastly, all the possible options you mention although correct, I think they miss the point.
If you have this:
fetch("someapi.com")
.then(foo);
bar();
The point is to refactor into async/await but keep the exact same behaviour.
It does not matter much what that behaviour is on the example (functions don't even have a body here).
Cheers! 🍻 happy coding
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Well, you are not wrong because this is pretty much a personal preference.
I just do not agree with you. 😎
Lastly, all the possible options you mention although correct, I think they miss the point.
If you have this:
The point is to refactor into async/await but keep the exact same behaviour.
It does not matter much what that behaviour is on the example (functions don't even have a body here).
Cheers! 🍻 happy coding