1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

new-style callback function (inject node)

This commit is contained in:
Kunihiko Toumura 2019-11-29 09:17:30 +09:00
parent 8b36279e52
commit 756a6ec5aa

View File

@ -98,7 +98,7 @@ module.exports = function(RED) {
node.repeaterSetup(); node.repeaterSetup();
} }
this.on("input", function(msg) { this.on("input", function(msg, send, done) {
var errors = []; var errors = [];
this.props.forEach(p => { this.props.forEach(p => {
@ -128,9 +128,10 @@ module.exports = function(RED) {
}); });
if (errors.length) { if (errors.length) {
node.error(errors.join('; '), msg); done(errors.join('; '));
} else { } else {
node.send(msg); send(msg);
done();
} }
}); });
} }