Lets say i have 2 promises promise1, promise2
that go off and do something asynchronously.
promise2 depends on promise1 being done before running itself. This is easy enough.
function runPromises(){
return promise1().done(function(){
promise2();
});
}
The problem is i also want to know when they have both finished.
runPromises().done(function(){
alert("promise 1 and 2 done");
});
currently runPromises is alerting when promise1 is done not both.