#8256 closed enhancement (wontfix)
$.when should accept an array of promises
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | deferred | Version: | 1.5 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description (last modified by )
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?
Change History (10)
comment:1 Changed 12 years ago by
Description: | modified (diff) |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
comment:2 Changed 12 years ago by
Component: | unfiled → core |
---|---|
Priority: | undecided → low |
comment:4 Changed 12 years ago by
Component: | core → deferred |
---|
comment:7 follow-up: 8 Changed 11 years ago by
So, considering the number of requests for this feature, I'm wondering if we should consider adding support?
comment:8 Changed 11 years ago by
Replying to 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.
comment:9 Changed 11 years ago by
@jaubourg TBH, I'm willing to go with whatever you recommend, but I also still think it's feature creep/bloat
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.