Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That doesn't look like well written async code at all... You're not supposed to use await literally everywhere and especially not multiple times in a single line.

Javascript already has an answer to this (Hint it was inspired by Monads but it isn't one):

await foo.then(f => f.bar()).then(b => b.baz())



What happens if f.bar() throws an exception asynchronously?




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: