add object bounding box visualization, broker function wrappers
This commit is contained in:
parent
8cd2a22a54
commit
a64ef24dbe
6 changed files with 57 additions and 8 deletions
|
|
@ -82,6 +82,7 @@ gapp.broker = new class Broker {
|
|||
} else if (topic.indexOf(".topic.") < 0) {
|
||||
dbug.debug(`undelivered '${topic}'`, message);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
// return function bound to a topic
|
||||
|
|
@ -91,6 +92,14 @@ gapp.broker = new class Broker {
|
|||
broker.publish(topic, message || msg, options || opt);
|
||||
}
|
||||
}
|
||||
|
||||
// return function wrapper that publishes a message to a topic
|
||||
wrap(topic, fn) {
|
||||
let broker = this;
|
||||
return function() {
|
||||
return broker.publish(topic, fn(...arguments));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
})();
|
||||
|
|
|
|||
Loading…
Reference in a new issue