Commit c57590e1 authored by Tristan Cavelier's avatar Tristan Cavelier

promy join and choose cancels promises when cancel method exist

parent 60e79a08
......@@ -642,9 +642,11 @@
function cancel() {
var j;
for (j = 0; j < promises.length; j += 1) {
if (typeof promises[j].cancel === 'function') {
promises[j].cancel();
}
}
}
deferred = new Deferred(cancel);
function succeed(j) {
return function (answer) {
......@@ -691,9 +693,11 @@
function cancel() {
var j;
for (j = 0; j < promises.length; j += 1) {
if (typeof promises[j].cancel === 'function') {
promises[j].cancel();
}
}
}
deferred = new Deferred(cancel);
function succeed(answer) {
cancel();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment