-
Notifications
You must be signed in to change notification settings - Fork 22
What about Async, Await and Generators?
I have seen what feels like 1,000 articles on how Async/Await killed Promises, "victory!" Right?
Not so fast.
While there are a few excellent articles appropriately skeptical of async/await, such as ES7 async functions - a step in the wrong direction
Most of the press out there seems closer to articles like From Promise API to Async-Await and 6 Reasons Why JavaScript’s Async/Await Blows Promises Away
The issue with these articles? They use weak Promise examples, and are usually too oversimplified to make any real conclusion.
Here's how I might refactor one of those code samples:

Simple examples are merely distracting, the Async/Await feature itself is too flexible, allowing poorly thought-out spaghetti code.
Perhaps more sinister, the initial version may seem great - even if only running single-threaded.
Inevitably as time passes, features are added and before long you have a mess. ("Let's add a permissions check, stick it before profile.update(); add a special logging call there too..." - please just stop smashing crap together & committing.)
- Steps
- Bonus Material