4 ms·
But it does require knowledge of generators. You're suspending a function during execution; that's what a generator is. We could've just named a global `async`
by jkoudys 7y ago
But it does require knowledge of generators. You're suspending a function during execution; that's what a generator is. We could've just named a global `async` that declares a coroutine FN on promises, and named `yield` as `await`, and the whole thing would look identical to now except for an extra paren and asterisk. You wouldn't need to understand their inner workings any more than you do with async/await now.
- coldtea 7y ago>But it does require knowledge of generators. You're suspending a function during execution; that's what a generator is. That's like saying "Ordering from Amazon does require knowledge of driving a van. That's how the stuff comes to your home!".
- tiglionabbit 7y agoNo it's not. If the syntax is that similar, your metaphor makes no sense.