@soundworks/core 3.5.1 → 3.7.0

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/server/Socket.js CHANGED
@@ -7,14 +7,12 @@ exports.default = void 0;
7
7
 
8
8
  var _socketsEncoderDecoder = require("../common/sockets-encoder-decoder.js");
9
9
 
10
- const noop = () => {};
11
-
12
- let counter = 0;
13
- const CONNECTING = 0;
14
- const OPEN = 1;
15
- const CLOSING = 2;
16
- const CLOSED = 3;
17
- const READY_STATES = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'];
10
+ const noop = () => {}; // const CONNECTING = 0;
11
+ // const OPEN = 1;
12
+ // const CLOSING = 2;
13
+ // const CLOSED = 3;
14
+ // const READY_STATES = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'];
15
+
18
16
  /**
19
17
  * Simple wrapper with simple pubsub system built on top of `ws` sockets.
20
18
  * The abstraction contains two different socket:
@@ -27,6 +25,7 @@ const READY_STATES = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'];
27
25
  * @memberof server
28
26
  */
29
27
 
28
+
30
29
  class Socket {
31
30
  constructor(ws, binaryWs, rooms, sockets, options = {}) {
32
31
  /**
@@ -115,7 +114,7 @@ class Socket {
115
114
  this._isAlive = false;
116
115
  this.ws.ping(noop);
117
116
  }, this.config.pingInterval);
118
- this.ws.addListener('error', err => {// console.log(this.clientId, err);
117
+ this.ws.addListener('error', _err => {// console.log(this.clientId, err);
119
118
  });
120
119
  }
121
120
  /**
@@ -128,7 +127,7 @@ class Socket {
128
127
  terminate() {
129
128
  clearInterval(this._intervalId); // clean rooms
130
129
 
131
- for (let [key, room] of this.rooms) {
130
+ for (let [_key, room] of this.rooms) {
132
131
  room.delete(this);
133
132
  } // clear references to sockets and rooms
134
133
 
package/server/Sockets.js CHANGED
@@ -181,6 +181,5 @@ class Sockets {
181
181
 
182
182
  }
183
183
 
184
- ;
185
184
  var _default = Sockets;
186
185
  exports.default = _default;