Skip to content

Commit 14bf642

Browse files
committed
add example for onAny
1 parent ae28a02 commit 14bf642

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ let socket = SocketIOClient(socketURL: "https://localhost:8080", opts: [
4646
"forcePolling": true // if true, the socket will only use XHR polling, default is false (polling/WebSockets)
4747
])
4848

49+
// Called on every event
50+
socket.onAny {println("got event: \($0.event) with items \($0.items)")}
51+
4952
// Socket Events
5053
socket.on("connect") {data, ack in
5154
println("socket connected")

0 commit comments

Comments
 (0)