I have this code:
var getStuff = function(resources, callback, progressCallback){
var deferreds = [];
for(var idx = 0; idx < resources.length; idx++){
...
deferreds.push(<some action>);
}
jQuery.when.apply(null, deferreds).then(function(){
callback && callback();
});
});
So, this will trigger my callback if I call it with:
getStuff([
'foo',
'bar'
], function(){
console.log("Finished doing stuff!");
});
Question is: How can I make a progressCallback?
Something like:
getStuff([
'foo',
'bar'
], function(){
console.log("Finished doing stuff!");
}, function(obj){
console.log("Doing stuff with obj: " + obj);
});
Regards!
You could try this approach (I didn’t tried)