File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
templates/swift/Sources/Services Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -23,15 +23,15 @@ open class Realtime : Service {
2323 private var subscriptionsCounter = 0
2424 private var reconnect = true
2525
26- private var onErrorCallback: ((Swift.Error?, HTTPResponseStatus?) -> Void)?
27- private var onCloseCallback: (() -> Void)?
26+ private var onErrorCallbacks: [ ((Swift.Error?, HTTPResponseStatus?) -> Void)] = []
27+ private var onCloseCallbacks: [ (() -> Void)] = []
2828
2929 public func onError(_ callback: @escaping (Swift.Error?, HTTPResponseStatus?) -> Void) {
30- self.onErrorCallback = callback
30+ self.onErrorCallbacks.append( callback)
3131 }
3232
3333 public func onClose(_ callback: @escaping () -> Void) {
34- self.onCloseCallback = callback
34+ self.onCloseCallbacks.append( callback)
3535 }
3636
3737 private func startHeartbeat() {
You can’t perform that action at this time.
0 commit comments