Last active
August 29, 2015 14:19
-
-
Save Ky6uk/0b227e5421e4c3d00839 to your computer and use it in GitHub Desktop.
Plz wait em all
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var whenAll = function (...deferreds) { | |
var _promises = []; | |
deferreds.forEach(function (deferred) { | |
var _deferred = new $.Deferred; | |
deferred.always(function () { | |
_deferred.resolve(); | |
}); | |
_promises.push(_deferred.promise()); | |
}); | |
return $.when(..._promises); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment