Instantiates, Configures and begins execution of a new sequence
Parameters:
| Name | Type | Description |
|---|---|---|
Object |
Object | Array | Object containing each of the following as keys [sequence, args, callback], OR array containing Functions or Arrays of Functions for execution |
- Source:
- See:
Returns:
- Type
- Sequencer
Examples
//Return the sequencer for use elsewhere
//Implied args
var ssync= require('bsync')
var sequence1 = bsync.sequence([
function1,
function2
],{
arg1 : "String",
arg2 : true
},function(err, data) {
//Do something with the result of the final output
});
//Implied Args
bsync.sequence([
function1,
function2
],{
arg1 : "String",
arg2 : true
},function(err, data) {
//Do something with the result of the final output
});
//Explicit args
bsync.sequence({
sequence:[
function1,
function2
],
args: {
arg1 : "String",
arg2 : true
},
callback: function(err, data) {
//Do something with the result of the final output
}
});