4 ms·
> Why would ES6 "pick a promises winner"? If they don't, the surrounding ecosystem is less likely to standardize on a single promise implementation. That means
by munificent 14y ago
> Why would ES6 "pick a promises winner"?
If they don't, the surrounding ecosystem is less likely to standardize on a single promise implementation. That means you'll have fragmentation where foo uses Futures and bar uses Promises so you have to use a bunch of Future<->Promise shims to get them to play together.
This is actually something I think is really nice about Dart: Futures are baked into the core library so they are The Way(tm) to pass around asynchronous computations.
- jasondenizac 14y agoPromise consumers have a very small interface to worry about, and in fact there are many interoperable implementations (Q, when, rsvp, etc). Unfortunately, jQuery is not one of those implementations, because rejections don't propagate. At any rate, JavaScript is not built around having a monolithic base library, and as others have pointed out, it would not make sense to have language level support for promises per se. However, I do agree that it would be great to have host APIs, for example, DOM, to make more widespread use of promises. In fact, WinJS for Windows 8 _does_ make use of promises in their async APIs.
- masklinn 14y ago> If they don't, the surrounding ecosystem is less likely to standardize on a single promise implementation. There's no need for a single promise implementation as long as they all implement the same API, in this case CommonJS Promises/A. And for the most part they do and are interoperable.