Are there standards or emerging standards for extended promise functions such as .all()
, .finally()
, .catch()
, .spread()
,
I know about the Promises A+ spec, but that only appears to deal with
.then()
Yes. The aim of the Promises/A+ spec is to "detail the behavior of the then method, providing an interoperable base which all Promises/A+ conformant promise implementations can be depended on to provide" and also describes promise assimilation, i.e. how to convert a promise-like object to a "real" Promise of your own library. In one word, it focuses on interoperability by speccing the minimum interface.
I can't find standards for all the other useful functions.
Yes. Every library does define its own. "Standards" emerge when a particular feature is present in (and copied to) many implementations.
My motivation for wanting to understand what the current and future standards development looks like is to know which current functions offered in the various libraries are more likely to be consistent with future standards and which are not so I can write code that will need less maintenance in this area in the future.
Probably watching the issue discussions of the big implementations is the best idea. However, most of the offered features are relatively easy to polyfill.
The gold standard will be ES6 and ES7. Check the esdiscuss mailing list regularly for discussion of features, questions on the usage, and new drafts.
I can see Promise.all() in an ES6 draft spec, but don't see any of the others.
If you look more closely, the Promise section details:
Promise
constructor, Promise.reject
and Promise.resolve
Promise.all
and Promise.race
Promise.prototype.catch
and Promise.prototype.then
.finally()
,.catch()
,.spread()
,.settle()
finally
was discussed on esdiscuss (e.g. here), but probably won't make it into ES6.catch
spread
is superseded by the spread operator and destructuringsettle
could be implemented using all
, or at least using an algorithm very close to the all
spec