document connect data item
This commit is contained in:
parent
141b0ce6bc
commit
beaa4b695c
@ -48,7 +48,15 @@ extension SocketIOClientSpec {
|
|||||||
|
|
||||||
/// The set of events that are generated by the client.
|
/// The set of events that are generated by the client.
|
||||||
public enum SocketClientEvent : String {
|
public enum SocketClientEvent : String {
|
||||||
/// Emitted when the client connects. This is also called on a successful reconnection.
|
/// Emitted when the client connects. This is also called on a successful reconnection. A connect event gets one
|
||||||
|
/// data item: the namespace that was connected to.
|
||||||
|
///
|
||||||
|
/// ```swift
|
||||||
|
/// socket.on(clientEvent: .connect) {data, ack in
|
||||||
|
/// guard let nsp = data[0] as? String else { return }
|
||||||
|
/// // Some logic using the nsp
|
||||||
|
/// }
|
||||||
|
/// ```
|
||||||
case connect
|
case connect
|
||||||
|
|
||||||
/// Called when the socket has disconnected and will not attempt to try to reconnect.
|
/// Called when the socket has disconnected and will not attempt to try to reconnect.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user