Async/Await without Promises
at paolo.fr▼4 up and 3 down, posted by
4 up and 3 down, posted by
While interesting, several of the examples don't account for errors, and are bad advice all around. You're better off using async functions or explicitly using/returning proper promises, or at least account for error conditions.
const Foo = { async then (done) { done(await request('https://foo.com')) } } What happens when request throws an error (or the promise rejects)? ... in this case, there's no value to it.