add object bounding box visualization, broker function wrappers

This commit is contained in:
Stewart Allen 2022-01-01 12:12:57 -05:00
commit a64ef24dbe
6 changed files with 57 additions and 8 deletions

View file

@ -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));
}
}
}
})();