I've looked at Promise.all
but I need something different, it doesn't matter whether few gets rejected, as long as one or promises are resolved, I'm interested to get hold of the results. Is there a pattern?
Context is http
trying to download an image from a remote server and few of the promises may not be successful but I'm interested in get hold of the whatever images I can.
Edit:
I've copied the shim from the page in my code followed by this, is there anything wrong in here?
var p1 = new Promise(function(resolve, reject){
setTimeout(resolve, 200);
});
var p2 = new Promise(function(resolve, reject){
setTimeout(resolve, 200);
});
var p3 = new Promise(function(resolve, reject){
setTimeout(resolve, 300);
});
Promise.settle([p1, p2, p3]).then(function(results){
console.log('done')
});