We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b3f0cab commit f9c16f2Copy full SHA for f9c16f2
lib/socket.ts
@@ -151,7 +151,7 @@ export class Socket<
151
public readonly io: Manager<ListenEvents, EmitEvents>;
152
153
/**
154
- * A unique identifier for the session.
+ * A unique identifier for the session. `undefined` when the socket is not connected.
155
*
156
* @example
157
* const socket = io();
@@ -162,7 +162,7 @@ export class Socket<
162
* console.log(socket.id); // "G5p5..."
163
* });
164
*/
165
- public id: string;
+ public id: string | undefined;
166
167
168
* The session ID used for connection state recovery, which must not be shared (unlike {@link id}).
0 commit comments