Opened 9 years ago

Closed 9 years ago

#14527 closed enhancement (wontfix)

DeferredList should accept values as well as deferreds

Reported by: mg Owned by: Mark Wubben
Priority: high Milestone: 1.8
Component: Core Version: 1.7.1
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

I like to propose the attached patch to DeferredList. DL should accept values as input as well as deferreds, i.e. show the same behaviour that dojo.when() has.

For example:

 var d = new dojo.Deferred();
 var v = "foo";
 var dl = new dojo.DeferredList([d, v]);

Attachments (1)

DeferredList.patch (1.3 KB) - added by mg 9 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 9 years ago by bill

Description: modified (diff)

Thanks for the patch. Two things:

  • no new code should be referencing "dojo" anymore. Everything is AMD and nameless now, meaning that in this case you should call Deferred.when() not dojo.when()

Changed 9 years ago by mg

Attachment: DeferredList.patch added

comment:2 Changed 9 years ago by mg

  • I adjusted the patch to use Deferred.when()
  • This patch is my first contribution to dojo. I just signed a CLA and emailed it to cla(at) Please let me know if you need me to do anything else.

comment:3 Changed 9 years ago by bill

Component: GeneralCore

dojo/promise/all may already handle this? It's got the line:

some(array, function(valueOrPromise, index)

(note the "valueOrPromise")

comment:4 Changed 9 years ago by bill

Owner: set to Mark Wubben
Status: newassigned

comment:5 Changed 9 years ago by Mark Wubben

Owner: changed from Mark Wubben to bill

In 1.8 dojo/promise/all essentially supersedes dojo/DeferredList. In light of those changes not sure if we need to update the DeferredList? implementation. Bill, thoughts?

comment:6 Changed 9 years ago by bill

Milestone: tbd1.8

I don't want to you update DeferredList. I meant for you to close this ticket as fixed if dojo/promise/all handles this (ie, it can handle plain values as well as promises). Alternately you could close the ticket as wontfix (it's just a question of semantics). The main thing is to close the ticket if we have a solution to the problem.

comment:7 Changed 9 years ago by bill

Owner: changed from bill to Mark Wubben

comment:8 Changed 9 years ago by Mark Wubben

Resolution: wontfix
Status: assignedclosed

wontfix it is then, this functionality will be provided in 1.8.

Note: See TracTickets for help on using tickets.