@arcblock/ws 1.18.44 → 1.18.46

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,12 +18,12 @@ module.exports = (Socket, EventEmitter, transport) => {
18
18
  this._logger.error('socket error', err.error);
19
19
  });
20
20
  this.onMessage((message) => {
21
- this._logger.debug('socket message', { message });
21
+ this._logger.debug('socket message', message);
22
22
  });
23
23
  }
24
24
 
25
- on(event, handler) {
26
- this.ensureJoinChannel(event);
25
+ on(event, handler, params = {}) {
26
+ this.ensureJoinChannel(event, params);
27
27
  this.emitter.on(event, handler);
28
28
  }
29
29
 
@@ -47,14 +47,14 @@ module.exports = (Socket, EventEmitter, transport) => {
47
47
  /**
48
48
  * private
49
49
  */
50
- ensureJoinChannel(event) {
50
+ ensureJoinChannel(event, params = {}) {
51
51
  const count = this.emitter.listenerCount(event);
52
52
  if (count > 0) {
53
53
  return;
54
54
  }
55
55
 
56
56
  const topic = event;
57
- const channel = this.channel(topic);
57
+ const channel = this.channel(topic, params);
58
58
  channel
59
59
  .join()
60
60
  .receive('ok', (message) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ws",
3
- "version": "1.18.44",
3
+ "version": "1.18.46",
4
4
  "description": "OCAP Chain websocket server and client",
5
5
  "keywords": [
6
6
  "websocket"
@@ -34,7 +34,7 @@
34
34
  "url": "https://github.com/ArcBlock/asset-chain/issues"
35
35
  },
36
36
  "dependencies": {
37
- "@arcblock/event-hub": "1.18.44",
37
+ "@arcblock/event-hub": "1.18.46",
38
38
  "debug": "^4.3.4",
39
39
  "eventemitter3": "^4.0.7",
40
40
  "lodash": "^4.17.21",
@@ -45,5 +45,5 @@
45
45
  "devDependencies": {
46
46
  "get-port": "^5.1.1"
47
47
  },
48
- "gitHead": "563803a77461e59d630e283f0c00e975c47f6ebf"
48
+ "gitHead": "6d5e72c4e83ae2fc4fd1fac8214991691b365131"
49
49
  }