apps-mqtt 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apps-mqtt",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/emitter.js CHANGED
@@ -21,10 +21,6 @@ class Emitter {
21
21
  }
22
22
  }
23
23
 
24
- // setInterval(() => {
25
- // Emitter.emit('/v1/emails', {})
26
- // }, 2000);
27
-
28
24
  // setTimeout(() => {
29
25
  // Emitter.emit('/v1/emails', {
30
26
  // from: {
package/src/listeners.js CHANGED
@@ -1,10 +1,9 @@
1
1
  const log4js = require('log4js');
2
2
 
3
3
  class Listeners {
4
- start(db, client) {
5
- this.db = db;
6
- this.client = client;
4
+ start(client) {
7
5
  this.logger = log4js.getLogger('listeners');
6
+ this.client = client;
8
7
  this.handlers = {};
9
8
  }
10
9
 
package/src/mqtt.js CHANGED
@@ -8,16 +8,14 @@ const listeners = new Listeners();
8
8
  const subscribers = new Subscribers();
9
9
 
10
10
  class Mqtt {
11
- constructor(config, db) {
11
+ constructor(config) {
12
12
  this.logger = log4js.getLogger('mqtt');
13
- this.db = db;
14
13
  this.config = config;
15
14
  this.client = mqtt.connect(config.path, {
16
15
  username: config.username,
17
16
  password: config.password,
18
17
  });
19
- listeners.start(this.db, this.client);
20
- subscribers.start(this.db, this.client);
18
+ listeners.start(this.client);
21
19
  Emitter.set_client(this.client);
22
20
  }
23
21
 
package/src/subcribers.js CHANGED
@@ -1,9 +1,7 @@
1
1
  const log4js = require('log4js');
2
2
 
3
3
  class Subscribers {
4
- start(db, client) {
5
- this.db = db;
6
- this.client = client;
4
+ constructor() {
7
5
  this.handlers = {};
8
6
  this.logger = log4js.getLogger('subscriber');
9
7
  }