3 ms·
In browser JS can drop down to the old Promise callbacks (.then) to avoid coloring synchronous callers.
by kitten_mittens_ 6y ago
In browser JS can drop down to the old Promise callbacks (.then) to avoid coloring synchronous callers.
- brundolf 6y agoIf 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.