12 lines
265 B
JavaScript
12 lines
265 B
JavaScript
|
class Socket {
|
||
|
constructor({ initialState='CONNECTING', socket }) {
|
||
|
this._state = initialState;
|
||
|
this._socket = socket;
|
||
|
|
||
|
this._socket.on('data', (e) => {
|
||
|
console.log(e.toString());
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module.exports = Socket;
|