more name binding cleanup

This commit is contained in:
Stewart Allen 2021-12-29 07:54:16 -05:00
commit 61ad82be61
2 changed files with 5 additions and 5 deletions

View file

@ -69,7 +69,7 @@ function init() {
} }
// add space event bindings // add space event bindings
broker.subscribe('space.init', data => { broker.subscribe('space_init', data => {
let { space, platform } = data; let { space, platform } = data;
let platcolor = 0x00ff00; let platcolor = 0x00ff00;
// add file drop handler // add file drop handler
@ -101,7 +101,7 @@ broker.subscribe('space.init', data => {
}); });
// add object loader // add object loader
broker.subscribe('space.load', data => { broker.subscribe('space_load', data => {
console.log({space_load: data}); console.log({space_load: data});
}); });
@ -117,8 +117,8 @@ document.onreadystatechange = function() {
// finalize modules // finalize modules
gapp.finalize("main.mesh", [ gapp.finalize("main.mesh", [
"moto.broker", "moto.broker", // dep: moto.broker
"moto.space" "moto.space" // dep: moto.space
]); ]);
})(); })();

View file

@ -31,7 +31,7 @@ class Broker {
} }
if (channel.indexOf(listener) < 0) { if (channel.indexOf(listener) < 0) {
let send = this.send; let send = this.send;
let name = topic.replace(/\./g, '_'); let name = topic.replace(/[\\ \.-]/g, '_');
send[name] = send[name] = this.bind(topic); send[name] = send[name] = this.bind(topic);
channel.push(listener); channel.push(listener);
this.publish(".topic.add", topic); this.publish(".topic.add", topic);