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

In browser JS can drop down to the old Promise callbacks (.then) to avoid coloring synchronous callers.


If any part of your function depends on the result of a promise then it has to return a promise; this is true whether you use async/await syntax or then(). Unfortunately JS doesn't have something like block_on, which now that I think about it is probably because it's single-threaded, so any block would block the entire app.




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

Search: