3 ms·
It doesn't matter at all what kind of promise flavor an API returns because promise implementations treat other implementations as interchangeable. Even the ES
by esailija 12y ago
It doesn't matter at all what kind of promise flavor an API returns because promise implementations treat other implementations as interchangeable.
Even the ES6 Promises implementation supports this:
Promise.all([{
then: function(r) {
r(3);
}
}]).then(function(result) {
console.log(result);
});
Here the plain object with then could have been any promise implementation, even jQuery, and it still works.
- thomasfoster96 12y agoI do understand that, but it'd be very nice to be able to do some things like timeouts and the like, without loading quite a few kilobytes of another promise implementation.