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
Unsure if this is a typescript problem, or something related to the definition of p-all's types
It seems that if the task passed to pAll uses .then internally, the api fails to infer the proper type of the result, unless the task is defined as async.
I am using pAll in a complex scenario, but a simplified code in which I was able to reproduce the bug is:
Unsure if this is a typescript problem, or something related to the definition of p-all's types
It seems that if the task passed to
pAll
uses.then
internally, the api fails to infer the proper type of the result, unless the task is defined as async.I am using
pAll
in a complex scenario, but a simplified code in which I was able to reproduce the bug is:If I hover on visual studio code,
results
is inferred asunknown[]
The proper inference should be
{ n: number } []
Workaround
If the task is defined as
async
, theresults
type is inferred correctlyThe type is now correctly inferred
If I use an intermediate variable, it also works (without async)
if I hover on VS code:
type is correctly inferred
Test that should pass
The text was updated successfully, but these errors were encountered: