cm-web-modules
Advanced tools
Comparing version 1.5.8 to 1.5.9
{ | ||
"name": "cm-web-modules", | ||
"version": "1.5.8", | ||
"version": "1.5.9", | ||
"description": "Collection of clean and small ES6 modules for the web", | ||
@@ -5,0 +5,0 @@ "main": "src/LibraryManager.js", |
@@ -14,2 +14,12 @@ /** | ||
subscribe(topic, callback) { | ||
if(!topic) { | ||
const message = "subscribe: no topic" | ||
console.error(message, callback) | ||
throw new Error(message) | ||
} | ||
if(!callback) { | ||
const message = "subscribe: no callback" | ||
console.error(message, topic) | ||
throw new Error(message) | ||
} | ||
if (this.topics[topic] === undefined) { | ||
@@ -50,2 +60,7 @@ this.topics[topic] = [] | ||
publish(topic, object = {}, async = true) { | ||
if(!topic) { | ||
const message = "publish: no topic" | ||
console.error(message, callback) | ||
throw new Error(message) | ||
} | ||
const breadcrumbArray = topic.split("/") | ||
@@ -52,0 +67,0 @@ let wildcardTopic = "" |
105242
1894