remove some redundant connected checking
This commit is contained in:
parent
b73afe0da9
commit
6ff403fad1
@ -228,11 +228,6 @@ open class SocketIOClient : NSObject, SocketIOClientSpec {
|
|||||||
/// - parameter items: The items to send with this event. Send an empty array to send no data.
|
/// - parameter items: The items to send with this event. Send an empty array to send no data.
|
||||||
@objc
|
@objc
|
||||||
open func emit(_ event: String, with items: [Any]) {
|
open func emit(_ event: String, with items: [Any]) {
|
||||||
guard status == .connected else {
|
|
||||||
handleClientEvent(.error, data: ["Tried emitting \(event) when not connected"])
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
emit([event] + items)
|
emit([event] + items)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -62,11 +62,6 @@ public final class SocketRawView : NSObject {
|
|||||||
/// - parameter items: The items to send with this event. Send an empty array to send no data.
|
/// - parameter items: The items to send with this event. Send an empty array to send no data.
|
||||||
@objc
|
@objc
|
||||||
public func emit(_ event: String, with items: [Any]) {
|
public func emit(_ event: String, with items: [Any]) {
|
||||||
guard socket.status == .connected else {
|
|
||||||
socket.handleClientEvent(.error, data: ["Tried emitting \(event) when not connected"])
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
socket.emit([event] + items, binary: false)
|
socket.emit([event] + items, binary: false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user