Side navigation
#8256 closed enhancement (wontfix)
Opened February 12, 2011 12:02AM UTC
Closed February 12, 2011 12:18AM UTC
Last modified July 09, 2013 02:08PM UTC
$.when should accept an array of promises
Reported by: | me@adamluikart.com | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | deferred | Version: | 1.5 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
This would be super nice, because $.when.apply($, promisesArr) looks converugly.
I'm not sure if there's a case where you'd want an array to be treated like a resolved Deferred that this would break – if so, maybe you could peek at the first element to see if it's a promise?
Attachments (0)
Change History (10)
Changed February 12, 2011 12:18AM UTC by comment:1
description: | This would be super nice, because $.when.apply($, promisesArr) looks ugly. \ \ I'm not sure if there's a case where you'd want an array to be treated like a resolved Deferred that this would break – if so, maybe you could peek at the first element to see if it's a promise? → This would be super nice, because $.when.apply($, promisesArr) looks converugly. \ \ I'm not sure if there's a case where you'd want an array to be treated like a resolved Deferred that this would break – if so, maybe you could peek at the first element to see if it's a promise? |
---|---|
resolution: | → wontfix |
status: | new → closed |
Changed February 12, 2011 12:20AM UTC by comment:2
component: | unfiled → core |
---|---|
priority: | undecided → low |
Changed September 19, 2011 01:53PM UTC by comment:4
component: | core → deferred |
---|
Changed January 14, 2012 12:08AM UTC by comment:7
So, considering the number of requests for this feature, I'm wondering if we should consider adding support?
Changed January 14, 2012 10:35AM UTC by comment:8
Replying to [comment:7 rwaldron]:
So, considering the number of requests for this feature, I'm wondering if we should consider adding support?
If we do so, then we add the two liner given above. I think people are being lazy here and refuse to aknowledge the inconsistencies implied as long as "it works" for them.
Changed January 14, 2012 03:54PM UTC by comment:9
@jaubourg TBH, I'm willing to go with whatever you recommend, but I also still think it's feature creep/bloat
Changed July 09, 2013 02:08PM UTC by comment:10
#14117 is a duplicate of this ticket.
This would break things like:
Inspecting the first element only wouldn't make sense either.
You can easily code your own whenArray functionality if and when you're tired of apply:
A "deep" when could be nice though but that's another conversation.