News for hackers. Stuff that matters.
Re:Observable API Proposal by TeffenEllis on Friday July 28, 2023 @08:49PM (#36915549)
Huh wow! I did not know that! I think TypeScript always kept this hidden from me, but it makes sense. Another perk of `await` is that it collapses all promises into their final value, regardless of how many nested pending promises are expressed:

  const foo = await Promise.resolve(Promise.resolve("abc"))

  console.log(foo.length) // 3
Re:Observable API Proposal by bakkoting on Saturday July 29, 2023 @12:36PM (#36921902)
It's not `await` which is doing that; it's the Promises themselves. For example:

   Promise.resolve(Promise.resolve("abc")).then(console.log)
This will print `"abc"`, not `Promise.resolve("abc")`.