3 ms·
When I plug in your example (in Chrome console and in the TypeScript compiler), `a` is type `() => Promise<{foo: string}>` and `b` is type `() => any`. I thoug
by shhsshs 7y ago
When I plug in your example (in Chrome console and in the TypeScript compiler), `a` is type `() => Promise<{foo: string}>` and `b` is type `() => any`.
I thought you had to actually provide a Promise to `Promise.all`, not functions that return promises (you have to invoke the functions):
const [ a, b ] = await Promise.all([
(async () => ({ foo: 'bar' }))(),
(() => null)(),
])
When I do this, `a` and `b` have their proper types.
- Klathmon 7y agoAh good catch, I was spacing on the easiest way to show how to easiest show the operator and forgot to invoke my functions!