Open bfgeek opened 6 years ago
The Working Group just discussed Generator vs. Promise design for the API
, and agreed to the following resolutions:
RESOLVED: We will continue adopting generators for layout functions.
(Note that the resolution was explicitly meant to require discussion, not to shut down the debate and settle on one or the other.)
A colleague noted the relationship of what's being done conceptually here to coroutines, although I'm not sure if that yields anything useful. (I vaguely recall that Ian might have mentioned that at the face-to-face meeting as well, though I don't see it minuted.)
Yeah, JS's iterator/yield and async/await are basically one-sided coroutines.
The Working Group just discussed Generator vs. Promise design for the API
, and agreed to the following:
RESOLVED: use Promises
There isn't actually a large difference between the two APIs from just looking at the script, i.e.
There are various pros/cons of each of these.
Generator:
await
on other APIs which might leak into the LWGS.Promise: