kriskowal / q

A promise library for JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

q series/mapSeries

jdnichollsc opened this issue · comments

Hi guys,

What do you think about to include q.mapSeries method like Bluebird?

Check my example please: https://gist.github.com/jdnichollsc/89aa64bffda68312ecfd3acd6294f1cc

Example with Q:

var incrementNumber = function(item){
      return Q.when(item.number++);
};
        
var numbers = [{ number: 1 }, { number: 2 }, { number: 3 }];
Q.mapSeries(numbers, function(item, index, length){
      return incrementNumber(item);
}).then(function(res){
      alert("End!");
});

Regards, Nicholls

I'd vote for this.