Bug Tracker

Changes between Initial Version and Version 1 of Ticket #8256


Ignore:
Timestamp:
Feb 11, 2011, 7:18:26 PM (12 years ago)
Author:
jaubourg
Comment:

This would break things like:

$.when( [ 1, 2, 3 ] );

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:

jQuery.whenArray = function( array ) {
    return jQuery.when.apply( this, array );
};

A "deep" when could be nice though but that's another conversation.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #8256

    • Property Status changed from new to closed
    • Property Resolution changed from to wontfix
  • Ticket #8256 – Description

    initial v1  
    1 This would be super nice, because $.when.apply($, promisesArr) looks ugly.
     1This would be super nice, because $.when.apply($, promisesArr) looks converugly.
    22
    33I'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?