You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What did you expect to happen?
I would expect this snippet to work properly. Async function is just a normal function that 100% returns Promise. If I return promise from the non-async function the result is exactly the same, so I do not understand why async package fails in this case.
What was the actual result?
The code did not execute properly.
The text was updated successfully, but these errors were encountered:
Async function is just a normal function that 100% returns Promise.
This is not entirely true, async functions have a detectable AsyncFunction type we can handle separately. If you're going to return a promise, it must explicitly use the async keyword so the library can handle it properly (and also not pass a callback).
I see. It confused me because I expected to get the same result for using native async function and simply returning a promise. I found an explanation here now: #1386
What version of async are you using?
3.2.0
Which environment did the issue occur in (Node/browser/Babel/Typescript version)
Node
What did you do? Please include a minimal reproducible case illustrating issue.
What did you expect to happen?
I would expect this snippet to work properly. Async function is just a normal function that 100% returns Promise. If I return promise from the non-async function the result is exactly the same, so I do not understand why async package fails in this case.
What was the actual result?
The code did not execute properly.
The text was updated successfully, but these errors were encountered: