Opened 8 years ago
Closed 8 years ago
#17411 closed defect (invalid)
dojo/promise/all buggy
Reported by: | Wouter Hager | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | tbd |
Component: | Core | Version: | 1.9.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
The following code doesn't show anything on the console, so all().then is never executed.
require(["dojo/Deferred","dojo/promise/all"],function(Deferred,all){
var proms = [];
for(var i=0;i<3;i++) {
var d = new Deferred(); setTimeout(function(){
d.resolve(true);
},10); proms.push(d.promise);
}
all(proms).then(function(res){
console.log(res);
});
});
Change History (2)
comment:1 Changed 8 years ago by
comment:2 Changed 8 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Right, the bug in your first code was that it resolved the third promise three times, and never resolved the first two.
Note: See
TracTickets for help on using
tickets.
The following code works, so nevermind: