interface instead of type

This commit is contained in:
Wolfgang Hottgenroth
2017-07-23 22:55:05 +02:00
parent dad740e620
commit 8685bdde87
4 changed files with 12 additions and 2 deletions

1
dist/main.js vendored
View File

@ -11,6 +11,7 @@ class Dispatcher {
exec() {
log.info("Dispatcher starting");
this._mqttClient.exec();
log.info("Dispatcher running");
}
}
const dispatcher = new Dispatcher();

3
dist/mqttclient.js vendored
View File

@ -26,6 +26,9 @@ class MqttClient {
for (let topicHandler of this._topicHandlers) {
if (this.topicMatch(topicHandler.topic, topic)) {
log.info(`received topic ${topic} matches registered topic ${topicHandler.topic}`);
if (topicHandler.callback != null) {
topicHandler.callback(payload);
}
}
}
});