@@ -23,16 +23,16 @@ export class Publisher<T> implements IPublish<T> {
2323 this . registerSnapshot ( snapshot || null ) ;
2424
2525 var onConnection = s => {
26- // this._log("socket", s.id, "connected for Publisher", topic);
26+ this . _log ( "socket" , s . id , "connected for Publisher" , topic ) ;
2727
28- // s.on("disconnect", () => {
29- // this._log("socket", s.id, "disconnected for Publisher", topic);
30- // });
28+ s . on ( "disconnect" , ( ) => {
29+ this . _log ( "socket" , s . id , "disconnected for Publisher" , topic ) ;
30+ } ) ;
3131
3232 s . on ( Prefixes . SUBSCRIBE + "-" + topic , ( ) => {
3333 if ( this . _snapshot !== null ) {
3434 var snapshot = this . _snapshot ( ) ;
35- // this._log("socket", s.id, "asking for snapshot on topic", topic);
35+ this . _log ( "socket" , s . id , "asking for snapshot on topic" , topic ) ;
3636 s . emit ( Prefixes . SNAPSHOT + "-" + topic , snapshot ) ;
3737 }
3838 } ) ;
@@ -84,7 +84,7 @@ export class Subscriber<T> implements ISubscribe<T> {
8484 private _log : ( ...args : any [ ] ) => void ) {
8585 this . _socket = io ;
8686
87- // this._log("creating subscriber to", this.topic, "; connected?", this.connected);
87+ this . _log ( "creating subscriber to" , this . topic , "; connected?" , this . connected ) ;
8888
8989 if ( this . connected )
9090 this . onConnect ( ) ;
@@ -100,7 +100,7 @@ export class Subscriber<T> implements ISubscribe<T> {
100100 }
101101
102102 private onConnect = ( ) => {
103- // this._log("connect to", this.topic);
103+ this . _log ( "connect to" , this . topic ) ;
104104 if ( this . _connectHandler !== null ) {
105105 this . _connectHandler ( ) ;
106106 }
@@ -109,7 +109,7 @@ export class Subscriber<T> implements ISubscribe<T> {
109109 } ;
110110
111111 private onDisconnect = ( ) => {
112- // this._log("disconnected from", this.topic);
112+ this . _log ( "disconnected from" , this . topic ) ;
113113 if ( this . _disconnectHandler !== null )
114114 this . _disconnectHandler ( ) ;
115115 } ;
@@ -120,13 +120,13 @@ export class Subscriber<T> implements ISubscribe<T> {
120120 } ;
121121
122122 private onSnapshot = ( msgs : T [ ] ) => {
123- // this._log("handling snapshot for", this.topic, "nMsgs:", msgs.length);
123+ this . _log ( "handling snapshot for" , this . topic , "nMsgs:" , msgs . length ) ;
124124 if ( this . _snapshotHandler !== null )
125125 this . _snapshotHandler ( msgs ) ;
126126 } ;
127127
128128 public disconnect = ( ) => {
129- // this._log("forcing disconnection from ", this.topic);
129+ this . _log ( "forcing disconnection from " , this . topic ) ;
130130 this . _socket . off ( "connect" , this . onConnect ) ;
131131 this . _socket . off ( "disconnect" , this . onDisconnect ) ;
132132 this . _socket . off ( Prefixes . MESSAGE + "-" + this . topic , this . onIncremental ) ;
@@ -183,8 +183,8 @@ export class Fire<T> implements IFire<T> {
183183
184184 constructor ( private topic : string , io : SocketIOClient . Socket , _log : ( ...args : any [ ] ) => void ) {
185185 this . _socket = io ;
186- // this._socket.on("connect", () => _log("Fire connected to", this.topic))
187- // .on("disconnect", () => _log("Fire disconnected to", this.topic));
186+ this . _socket . on ( "connect" , ( ) => _log ( "Fire connected to" , this . topic ) )
187+ . on ( "disconnect" , ( ) => _log ( "Fire disconnected to" , this . topic ) ) ;
188188 }
189189
190190 public fire = ( msg : T ) : void => {
@@ -205,14 +205,14 @@ export class Receiver<T> implements IReceive<T> {
205205 constructor ( private topic : string , io : SocketIO . Server ,
206206 private _log : ( ...args : any [ ] ) => void ) {
207207 var onConnection = ( s : SocketIO . Socket ) => {
208- // this._log("socket", s.id, "connected for Receiver", topic);
208+ this . _log ( "socket" , s . id , "connected for Receiver" , topic ) ;
209209 s . on ( Prefixes . MESSAGE + "-" + this . topic , msg => {
210210 if ( this . _handler !== null )
211211 this . _handler ( msg ) ;
212212 } ) ;
213- // s.on("error", e => {
214- // _log("error in Receiver", e.stack, e.message);
215- // });
213+ s . on ( "error" , e => {
214+ _log ( "error in Receiver" , e . stack , e . message ) ;
215+ } ) ;
216216 } ;
217217
218218 io . on ( "connection" , onConnection ) ;
0 commit comments