This commit is contained in:
2020-08-24 12:04:54 -04:00
parent 0ba7f86fc1
commit 7bd9fa8308
5 changed files with 203 additions and 53 deletions

View File

@@ -9,6 +9,8 @@ class PubSub{
topic = "__REGEX__";
}
// console.log(this)
//
// create the topic if not yet created
if(!this.topics[topic]) this.topics[topic] = [];
@@ -17,7 +19,7 @@ class PubSub{
}
matchTopics(topic){
let topics = [... this.topics[topic] ? this.topics[topic] : []]
let topics = [... this.topics[topic] ? this.topics[topic] : []];
// console.log(this.topics)
if(!this.topics['__REGEX__']) return topics;