Skip to content

Instantly share code, notes, and snippets.

View hvrauhal's full-sized avatar

Heikki Rauhala hvrauhal

View GitHub Profile
@hvrauhal
hvrauhal / bb.js
Last active June 3, 2019 10:59 — forked from stephantabor/bb.js
Bluebird .mapSeries vs .map
var Promise = require('bluebird');
var funcs = Promise.resolve([100, 200, 300, 400].map((n) => makeWait(n)));
console.log('first with {concurrency: 1}');
funcs
.map(iterator, {concurrency: 1})
.then(function(r) { console.log('Resolved with', r) } )
.then(function() {
console.log('then with mapSeries');