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
1 changed files with 4 additions and 3 deletions

View File

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