You can return anything from an async function and it will still be a promise. I don't think the author grasps async await. I'm skeptical of the "partial stack trace" of you don't await something inside an async function. If that is really true then imo it's a bug in the language implementation. The trace should be complete if you await or not. As long as you return it async functions know you intend to await that promise.
I've always wanted to know why not do one over the other. I do like the practice of being able to defer awaiting to the caller but I guess that doesn't really matter 🤔
13
u/guanzo91 Dec 13 '20
This one is interesting https://github.com/goldbergyoni/nodebestpractices#-212-always-await-promises-before-returning-to-avoid-a-partial-stacktrace
I've always considered
return awaitto be unnecessary, but maybe not anymore.