Skip to content

Commit 6ed90a3

Browse files
committed
clean up once
1 parent d2d9c49 commit 6ed90a3

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -128,19 +128,19 @@ Options
128128

129129
Methods
130130
-------
131-
1. `on(event: String, callback: ((data: [AnyObject], ack: SocketAckEmitter?) -> Void))` - Adds a handler for an event. Items are passed by an array. `ack` can be used to send an ack when one is requested. See example.
132-
2. `onAny(callback:((event: String, items: AnyObject?)) -> Void)` - Adds a handler for all events. It will be called on any received event.
133-
3. `emit(event: String, _ items: AnyObject...)` - Sends a message. Can send multiple items.
134-
4. `emit(event: String, withItems items: [AnyObject])` - `emit` for Objective-C
135-
5. `emitWithAck(event: String, _ items: AnyObject...) -> (timeoutAfter: UInt64, callback: (NSArray?) -> Void) -> Void` - Sends a message that requests an acknowledgement from the server. Returns a function which you can use to add a handler. See example. Note: The message is not sent until you call the returned function.
136-
6. `emitWithAck(event: String, withItems items: [AnyObject]) -> (UInt64, (NSArray?) -> Void) -> Void` - `emitWithAck` for Objective-C. Note: The message is not sent until you call the returned function.
137-
7. `connect()` - Establishes a connection to the server. A "connect" event is fired upon successful connection.
138-
8. `connect(timeoutAfter timeoutAfter: Int, withTimeoutHandler handler: (() -> Void)?)` - Connect to the server. If it isn't connected after timeoutAfter seconds, the handler is called.
139-
9. `close()` - Closes the socket. Once a socket is closed it should not be reopened.
140-
10. `reconnect()` - Causes the client to reconnect to the server.
141-
11. `joinNamespace()` - Causes the client to join nsp. Shouldn't need to be called unless you change nsp manually.
142-
12. `leaveNamespace()` - Causes the client to leave the nsp and go back to /
143-
13. `once(event: String, callback: NormalCallback)` - Adds a handler that will only be executed once.
131+
1. `on(event: String, callback: NormalCallback)` - Adds a handler for an event. Items are passed by an array. `ack` can be used to send an ack when one is requested. See example.
132+
2. `once(event: String, callback: NormalCallback)` - Adds a handler that will only be executed once.
133+
3. `onAny(callback:((event: String, items: AnyObject?)) -> Void)` - Adds a handler for all events. It will be called on any received event.
134+
4. `emit(event: String, _ items: AnyObject...)` - Sends a message. Can send multiple items.
135+
5. `emit(event: String, withItems items: [AnyObject])` - `emit` for Objective-C
136+
6. `emitWithAck(event: String, _ items: AnyObject...) -> (timeoutAfter: UInt64, callback: (NSArray?) -> Void) -> Void` - Sends a message that requests an acknowledgement from the server. Returns a function which you can use to add a handler. See example. Note: The message is not sent until you call the returned function.
137+
7. `emitWithAck(event: String, withItems items: [AnyObject]) -> (UInt64, (NSArray?) -> Void) -> Void` - `emitWithAck` for Objective-C. Note: The message is not sent until you call the returned function.
138+
8. `connect()` - Establishes a connection to the server. A "connect" event is fired upon successful connection.
139+
9. `connect(timeoutAfter timeoutAfter: Int, withTimeoutHandler handler: (() -> Void)?)` - Connect to the server. If it isn't connected after timeoutAfter seconds, the handler is called.
140+
10. `close()` - Closes the socket. Once a socket is closed it should not be reopened.
141+
11. `reconnect()` - Causes the client to reconnect to the server.
142+
12. `joinNamespace()` - Causes the client to join nsp. Shouldn't need to be called unless you change nsp manually.
143+
13. `leaveNamespace()` - Causes the client to leave the nsp and go back to /
144144

145145
Client Events
146146
------

SocketIOClientSwift/SocketIOClient.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ public final class SocketIOClient: NSObject, SocketEngineClient {
420420

421421
let id = NSUUID()
422422

423-
let handler = SocketEventHandler(event: event, id: id) {[weak self] (data, ack: SocketAckEmitter?) in
423+
let handler = SocketEventHandler(event: event, id: id) {[weak self] data, ack in
424424
guard let this = self else {return}
425425
this.handlers = ContiguousArray(this.handlers.filter {$0.id != id})
426426
callback(data, ack)

0 commit comments

Comments
 (0)