From 3ebc596ab8ecd5f2003fa64d43e865fc126e7fc2 Mon Sep 17 00:00:00 2001 From: Erik Date: Sat, 4 Apr 2015 12:22:37 -0400 Subject: [PATCH] clean up readme --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index a7f8dd3..447a32f 100644 --- a/README.md +++ b/README.md @@ -92,15 +92,15 @@ Options Methods ------- -1. `socket.on(name:String, callback:((data:NSArray?, ack:AckEmitter?) -> 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. -2. `socket.onAny(callback:((event:String, items:AnyObject?)) -> Void)` - Adds a handler for all events. It will be called on any received event. -3. `socket.emit(event:String, _ items:AnyObject...)` - Sends a message. Can send multiple items. -4. `socket.emitObjc(event:String, withItems items:[AnyObject])` - `emit` for Objective-C -5. `socket.emitWithAck(event:String, _ items:AnyObject...) -> (timeout: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. -6. `socket.emitWithAckObjc(event:String, withItems items:[AnyObject]) -> (UInt64, (NSArray?) -> Void) -> Void` - `emitWithAck` for Objective-C. -7. `socket.connect()` - Establishes a connection to the server. A "connect" event is fired upon successful connection. -8. `socket.connectWithParams(params:[String: AnyObject])` - Establishes a connection to the server passing the specified params. A "connect" event is fired upon successful connection. -9. `socket.close(#fast:Bool)` - Closes the socket. Once a socket is closed it should not be reopened. Pass true to fast if you're closing from a background task. +1. `on(name:String, callback:((data:NSArray?, ack:AckEmitter?) -> 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. +2. `onAny(callback:((event:String, items:AnyObject?)) -> Void)` - Adds a handler for all events. It will be called on any received event. +3. `emit(event:String, _ items:AnyObject...)` - Sends a message. Can send multiple items. +4. `emitObjc(event:String, withItems items:[AnyObject])` - `emit` for Objective-C +5. `emitWithAck(event:String, _ items:AnyObject...) -> (timeout: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. +6. `emitWithAckObjc(event:String, withItems items:[AnyObject]) -> (UInt64, (NSArray?) -> Void) -> Void` - `emitWithAck` for Objective-C. +7. `connect()` - Establishes a connection to the server. A "connect" event is fired upon successful connection. +8. `connectWithParams(params:[String: AnyObject])` - Establishes a connection to the server passing the specified params. A "connect" event is fired upon successful connection. +9. `close(#fast:Bool)` - Closes the socket. Once a socket is closed it should not be reopened. Pass true to fast if you're closing from a background task. Events ------