Loops.each()

Run a given machine on each item of an array.

Usage

Hover over inputs/exits for more info.

var Loops = require('machinepack-loops');


// Run a given machine on each item of an array.

Loops.each({

array: [],

worker: ,

series: false,

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function () {

 

},

});

Inputs

array required

The array to loop over

worker required

The machine to run on each item in the array.

series

Whether to run worker on one item at a time (in series)

false

Exits

error

An unexpected error occurred.

success

OK.