You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -150,8 +150,8 @@ case Secure(Bool) // If the connection should use TLS. Default is false.
150
150
```
151
151
Methods
152
152
-------
153
-
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.
154
-
2.`once(event: String, callback: NormalCallback)` - Adds a handler that will only be executed once.
153
+
1.`on(event: String, callback: NormalCallback) -> NSUUID` - 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. Returns a unique id for the handler.
154
+
2.`once(event: String, callback: NormalCallback) -> NSUUID` - Adds a handler that will only be executed once. Returns a unique id for the handler.
155
155
3.`onAny(callback:((event: String, items: AnyObject?)) -> Void)` - Adds a handler for all events. It will be called on any received event.
156
156
4.`emit(event: String, _ items: AnyObject...)` - Sends a message. Can send multiple items.
157
157
5.`emit(event: String, withItems items: [AnyObject])` - `emit` for Objective-C
@@ -164,7 +164,8 @@ Methods
164
164
12.`joinNamespace()` - Causes the client to join nsp. Shouldn't need to be called unless you change nsp manually.
165
165
13.`leaveNamespace()` - Causes the client to leave the nsp and go back to /
166
166
14.`off(event: String)` - Removes all event handlers for event.
167
-
15.`removeAllHandlers()` - Removes all handlers.
167
+
15.`off(id id: NSUUID)` - Removes the event that corresponds to id.
0 commit comments