From e0cbe59a102ffeb5697d1eff21ae4cd3d68ec023 Mon Sep 17 00:00:00 2001 From: Valentin Slawicek Date: Wed, 7 Nov 2018 13:53:25 +0100 Subject: [PATCH] Remove unnecessary function calls. --- Source/SocketIO/Client/SocketIOClient.swift | 20 +------------------ .../SocketIO/Client/SocketIOClientSpec.swift | 11 +--------- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/Source/SocketIO/Client/SocketIOClient.swift b/Source/SocketIO/Client/SocketIOClient.swift index ef83bcd..b05b0ec 100644 --- a/Source/SocketIO/Client/SocketIOClient.swift +++ b/Source/SocketIO/Client/SocketIOClient.swift @@ -204,25 +204,7 @@ open class SocketIOClient : NSObject, SocketIOClientSpec { leaveNamespace() } - /// Send an event to the server, with optional data items. - /// - /// 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. + /// 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]` diff --git a/Source/SocketIO/Client/SocketIOClientSpec.swift b/Source/SocketIO/Client/SocketIOClientSpec.swift index f2658a8..17cee73 100644 --- a/Source/SocketIO/Client/SocketIOClientSpec.swift +++ b/Source/SocketIO/Client/SocketIOClientSpec.swift @@ -92,16 +92,7 @@ public protocol SocketIOClientSpec : AnyObject { /// Disconnects the socket. func disconnect() - /// Send an event to the server, with optional data items. - /// - /// 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. + /// 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]`