Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library
← Back to context

Comment by ajifurai

3 months ago

Actually, TypeScript's `Promise.all` can handle different types too.

    const [a, b] = await Promise.all([fetchA(), fetchB()]); // => a: A, b: B

1 comment

ajifurai

Reply

greener_grass  3 months ago

I am talking about C# / F# context where the lists must have homogeneous types.

That TypeScript supports this is yet more complexity introduced to cover usages of an API not designed around types.

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities