mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Allow Serial nodes to close asynchonously
This commit is contained in:
@@ -35,11 +35,12 @@ function Node(n) {
|
||||
}
|
||||
|
||||
Node.prototype.on = function(event,callback) {
|
||||
var node = this;
|
||||
if (event == "close") {
|
||||
if (callback.length == 1) {
|
||||
this.close = function() {
|
||||
return when.promise(function(resolve) {
|
||||
callback(function() {
|
||||
callback.call(node,function() {
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user