Updated methods signature
This commit is contained in:
parent
c015012783
commit
ef6b63c82f
@ -212,7 +212,7 @@ open class SocketIOClient: NSObject, SocketIOClientSpec {
|
|||||||
/// - parameter items: The items to send with this event. May be left out.
|
/// - parameter items: The items to send with this event. May be left out.
|
||||||
/// - parameter completion: Callback called on transport write completion.
|
/// - parameter completion: Callback called on transport write completion.
|
||||||
open func emit(_ event: String, _ items: SocketData..., completion: (() -> ())? = nil) {
|
open func emit(_ event: String, _ items: SocketData..., completion: (() -> ())? = nil) {
|
||||||
emit(event, items, completion: completion)
|
emit(event, with: items, completion: completion)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Send an event to the server, with optional data items and optional write completion handler.
|
/// Send an event to the server, with optional data items and optional write completion handler.
|
||||||
@ -223,7 +223,7 @@ open class SocketIOClient: NSObject, SocketIOClientSpec {
|
|||||||
/// - parameter event: The event to send.
|
/// - parameter event: The event to send.
|
||||||
/// - parameter items: The items to send with this event. May be left out.
|
/// - parameter items: The items to send with this event. May be left out.
|
||||||
/// - parameter completion: Callback called on transport write completion.
|
/// - parameter completion: Callback called on transport write completion.
|
||||||
open func emit(_ event: String, _ items: [SocketData], completion: (() -> ())?) {
|
open func emit(_ event: String, with items: [SocketData], completion: (() -> ())?) {
|
||||||
|
|
||||||
do {
|
do {
|
||||||
emit([event] + (try items.map({ try $0.socketRepresentation() })), completion: completion)
|
emit([event] + (try items.map({ try $0.socketRepresentation() })), completion: completion)
|
||||||
@ -255,7 +255,7 @@ open class SocketIOClient: NSObject, SocketIOClientSpec {
|
|||||||
/// - parameter items: The items to send with this event. May be left out.
|
/// - parameter items: The items to send with this event. May be left out.
|
||||||
/// - returns: An `OnAckCallback`. You must call the `timingOut(after:)` method before the event will be sent.
|
/// - returns: An `OnAckCallback`. You must call the `timingOut(after:)` method before the event will be sent.
|
||||||
open func emitWithAck(_ event: String, _ items: SocketData...) -> OnAckCallback {
|
open func emitWithAck(_ event: String, _ items: SocketData...) -> OnAckCallback {
|
||||||
emitWithAck(event, items)
|
emitWithAck(event, with: items)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sends a message to the server, requesting an ack.
|
/// Sends a message to the server, requesting an ack.
|
||||||
@ -277,7 +277,7 @@ open class SocketIOClient: NSObject, SocketIOClientSpec {
|
|||||||
/// - parameter event: The event to send.
|
/// - parameter event: The event to send.
|
||||||
/// - parameter items: The items to send with this event. May be left out.
|
/// - parameter items: The items to send with this event. May be left out.
|
||||||
/// - returns: An `OnAckCallback`. You must call the `timingOut(after:)` method before the event will be sent.
|
/// - returns: An `OnAckCallback`. You must call the `timingOut(after:)` method before the event will be sent.
|
||||||
open func emitWithAck(_ event: String, _ items: [SocketData]) -> OnAckCallback {
|
open func emitWithAck(_ event: String, with items: [SocketData]) -> OnAckCallback {
|
||||||
|
|
||||||
do {
|
do {
|
||||||
return createOnAck([event] + (try items.map({ try $0.socketRepresentation() })))
|
return createOnAck([event] + (try items.map({ try $0.socketRepresentation() })))
|
||||||
|
|||||||
@ -116,7 +116,7 @@ public protocol SocketIOClientSpec : AnyObject {
|
|||||||
/// - parameter event: The event to send.
|
/// - parameter event: The event to send.
|
||||||
/// - parameter items: The items to send with this event. May be left out.
|
/// - parameter items: The items to send with this event. May be left out.
|
||||||
/// - parameter completion: Callback called on transport write completion.
|
/// - parameter completion: Callback called on transport write completion.
|
||||||
func emit(_ event: String, _ items: [SocketData], completion: (() -> ())?)
|
func emit(_ event: String, with items: [SocketData], completion: (() -> ())?)
|
||||||
|
|
||||||
/// Call when you wish to tell the server that you've received the event for `ack`.
|
/// Call when you wish to tell the server that you've received the event for `ack`.
|
||||||
///
|
///
|
||||||
@ -164,7 +164,7 @@ public protocol SocketIOClientSpec : AnyObject {
|
|||||||
/// - parameter event: The event to send.
|
/// - parameter event: The event to send.
|
||||||
/// - parameter items: The items to send with this event. May be left out.
|
/// - parameter items: The items to send with this event. May be left out.
|
||||||
/// - returns: An `OnAckCallback`. You must call the `timingOut(after:)` method before the event will be sent.
|
/// - returns: An `OnAckCallback`. You must call the `timingOut(after:)` method before the event will be sent.
|
||||||
func emitWithAck(_ event: String, _ items: [SocketData]) -> OnAckCallback
|
func emitWithAck(_ event: String, with items: [SocketData]) -> OnAckCallback
|
||||||
|
|
||||||
/// Called when socket.io has acked one of our emits. Causes the corresponding ack callback to be called.
|
/// Called when socket.io has acked one of our emits. Causes the corresponding ack callback to be called.
|
||||||
///
|
///
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user