function-tree
Advanced tools
Comparing version 0.4.3 to 0.4.5
{ | ||
"name": "function-tree", | ||
"version": "0.4.3", | ||
"version": "0.4.5", | ||
"description": "When a function is not enough", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -272,3 +272,3 @@ # function-tree | ||
// As an event (async) | ||
execute.on('error', function (err) { | ||
execute.on('error', function (error, execution, payload) { | ||
@@ -280,4 +280,4 @@ }) | ||
// As callback (sync) | ||
execute(tree, (err) => { | ||
if (err) { | ||
execute(tree, (error, execution, payload) => { | ||
if (error) { | ||
// There is an error | ||
@@ -465,3 +465,3 @@ } | ||
// When an error is thrown, also catches promise errors | ||
execute.on('error', (error) => {}) | ||
execute.on('error', (error, execution, payload) => {}) | ||
@@ -468,0 +468,0 @@ // When a function tree is executed |
@@ -36,3 +36,3 @@ 'use strict' | ||
payloads.push(payload) | ||
if (payloads.length === itemLength) runNextItem(assign({}, ...payloads)) | ||
if (payloads.length === itemLength) runNextItem(assign.apply(null, [{}].concat(payloads))) | ||
})) | ||
@@ -39,0 +39,0 @@ return payloads; |
@@ -185,5 +185,5 @@ 'use strict' | ||
var execution = new FunctionTreeExecution(name, staticTree, this, function(error) { | ||
cb && cb(error) | ||
cb && cb(error, execution, payload) | ||
setTimeout(function () { | ||
this.emit('error', error) | ||
this.emit('error', error, execution, payload) | ||
}.bind(this)) | ||
@@ -195,3 +195,3 @@ }.bind(this)) | ||
this.emit('end', execution, payload) | ||
cb && cb(null) | ||
cb && cb(null, execution, payload) | ||
}.bind(this)) | ||
@@ -198,0 +198,0 @@ }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
121038