Skip to content

Commit beaa4b6

Browse files
committed
document connect data item
1 parent 141b0ce commit beaa4b6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Source/SocketIOClientSpec.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,15 @@ extension SocketIOClientSpec {
4848

4949
/// The set of events that are generated by the client.
5050
public enum SocketClientEvent : String {
51-
/// Emitted when the client connects. This is also called on a successful reconnection.
51+
/// Emitted when the client connects. This is also called on a successful reconnection. A connect event gets one
52+
/// data item: the namespace that was connected to.
53+
///
54+
/// ```swift
55+
/// socket.on(clientEvent: .connect) {data, ack in
56+
/// guard let nsp = data[0] as? String else { return }
57+
/// // Some logic using the nsp
58+
/// }
59+
/// ```
5260
case connect
5361

5462
/// Called when the socket has disconnected and will not attempt to try to reconnect.

0 commit comments

Comments
 (0)