Skip to content

Commit

Permalink
refactor: remove duplicate initilializations (#1489)
Browse files Browse the repository at this point in the history
The attributes were already initialized, resulting in duplicate lines
in the final bundle.

Related: socketio/socket.io#4063
  • Loading branch information
anshul2807 authored and darrachequesne committed Aug 28, 2021
1 parent dfb46b5 commit f3acddf
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions lib/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export class Socket<
public readonly io: Manager<ListenEvents, EmitEvents>;

public id: string;
public connected: boolean;
public disconnected: boolean;
public connected: boolean = false;
public disconnected: boolean = true;

public auth: { [key: string]: any } | ((cb: (data: object) => void) => void);
public receiveBuffer: Array<ReadonlyArray<any>> = [];
Expand All @@ -74,13 +74,6 @@ export class Socket<
super();
this.io = io;
this.nsp = nsp;
this.ids = 0;
this.acks = {};
this.receiveBuffer = [];
this.sendBuffer = [];
this.connected = false;
this.disconnected = true;
this.flags = {};
if (opts && opts.auth) {
this.auth = opts.auth;
}
Expand Down

0 comments on commit f3acddf

Please sign in to comment.