From 61ad82be615ca80adde9d05d988857731ed1629c Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Wed, 29 Dec 2021 07:54:16 -0500 Subject: [PATCH] more name binding cleanup --- src/main/mesh.js | 8 ++++---- src/moto/broker.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/mesh.js b/src/main/mesh.js index cd6aed82..a9f74780 100644 --- a/src/main/mesh.js +++ b/src/main/mesh.js @@ -69,7 +69,7 @@ function init() { } // add space event bindings -broker.subscribe('space.init', data => { +broker.subscribe('space_init', data => { let { space, platform } = data; let platcolor = 0x00ff00; // add file drop handler @@ -101,7 +101,7 @@ broker.subscribe('space.init', data => { }); // add object loader -broker.subscribe('space.load', data => { +broker.subscribe('space_load', data => { console.log({space_load: data}); }); @@ -117,8 +117,8 @@ document.onreadystatechange = function() { // finalize modules gapp.finalize("main.mesh", [ - "moto.broker", - "moto.space" + "moto.broker", // dep: moto.broker + "moto.space" // dep: moto.space ]); })(); diff --git a/src/moto/broker.js b/src/moto/broker.js index 044f0e60..df12244d 100644 --- a/src/moto/broker.js +++ b/src/moto/broker.js @@ -31,7 +31,7 @@ class Broker { } if (channel.indexOf(listener) < 0) { let send = this.send; - let name = topic.replace(/\./g, '_'); + let name = topic.replace(/[\\ \.-]/g, '_'); send[name] = send[name] = this.bind(topic); channel.push(listener); this.publish(".topic.add", topic);