Calling:
poof( function (err) { console.log(err ? err : 'done'); });
Result:
empty array
items: []
cb: function () { [native code] }
done
var q = require('queue-flow'); | |
function asyncEmptyArray (args, callback) { | |
console.log('empty array'); | |
callback(null, []); | |
} | |
function poof (callback) { | |
q([null]) | |
.node(asyncEmptyArray, callback) | |
.map(function(arr) { return [arr]; }) | |
.node(function (items, cb) { | |
console.log('items: ' + JSON.stringify(items)) | |
console.log('cb: ' + cb) | |
cb(); | |
}, callback) | |
.on('close', function () { callback(); }); | |
} |
Calling:
poof( function (err) { console.log(err ? err : 'done'); });
Result:
empty array
items: []
cb: function () { [native code] }
done