Remove unnecessary function calls.

This commit is contained in:
Valentin Slawicek 2018-11-07 13:53:25 +01:00
parent 8f94c038d8
commit e0cbe59a10
2 changed files with 2 additions and 29 deletions

View File

@ -204,25 +204,7 @@ open class SocketIOClient : NSObject, SocketIOClientSpec {
leaveNamespace() leaveNamespace()
} }
/// Send an event to the server, with optional data items. /// Send an event to the server, with optional data items and optional write completion handler.
///
/// If an error occurs trying to transform `items` into their socket representation, a `SocketClientEvent.error`
/// will be emitted. The structure of the error data is `[eventName, items, theError]`
///
/// - parameter event: The event to send.
/// - parameter items: The items to send with this event. May be left out.
open func emit(_ event: String, _ items: SocketData...) {
do {
try emit(event, with: items.map({ try $0.socketRepresentation() }))
} catch {
DefaultSocketLogger.Logger.error("Error creating socketRepresentation for emit: \(event), \(items)",
type: logType)
handleClientEvent(.error, data: [event, items, error])
}
}
/// Send an event to the server, with optional data items and write completion handler.
/// ///
/// If an error occurs trying to transform `items` into their socket representation, a `SocketClientEvent.error` /// If an error occurs trying to transform `items` into their socket representation, a `SocketClientEvent.error`
/// will be emitted. The structure of the error data is `[eventName, items, theError]` /// will be emitted. The structure of the error data is `[eventName, items, theError]`

View File

@ -92,16 +92,7 @@ public protocol SocketIOClientSpec : AnyObject {
/// Disconnects the socket. /// Disconnects the socket.
func disconnect() func disconnect()
/// Send an event to the server, with optional data items. /// Send an event to the server, with optional data items and optional write completion handler.
///
/// If an error occurs trying to transform `items` into their socket representation, a `SocketClientEvent.error`
/// will be emitted. The structure of the error data is `[eventName, items, theError]`
///
/// - parameter event: The event to send.
/// - parameter items: The items to send with this event. May be left out.
func emit(_ event: String, _ items: SocketData...)
/// Send an event to the server, with optional data items and write completion handler.
/// ///
/// If an error occurs trying to transform `items` into their socket representation, a `SocketClientEvent.error` /// If an error occurs trying to transform `items` into their socket representation, a `SocketClientEvent.error`
/// will be emitted. The structure of the error data is `[eventName, items, theError]` /// will be emitted. The structure of the error data is `[eventName, items, theError]`