From c324063fb533708eb9cff2b11c580b3952ea52e6 Mon Sep 17 00:00:00 2001 From: Subeom Choi Date: Fri, 22 Mar 2024 11:25:18 +0900 Subject: [PATCH] change(SabyNetwork): make optionBlock escaping --- Source/Network/Client.swift | 6 +++--- Source/Network/Implement/Client/DataClient.swift | 2 +- Source/Network/Implement/Client/JSONClient.swift | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Network/Client.swift b/Source/Network/Client.swift index 589ceb8..0366d10 100644 --- a/Source/Network/Client.swift +++ b/Source/Network/Client.swift @@ -20,7 +20,7 @@ public protocol Client { header: ClientHeader, body: Request, timeout: Interval?, - optionBlock: (inout URLRequest) -> Void + optionBlock: @escaping (inout URLRequest) -> Void ) -> Promise, Error> } @@ -30,7 +30,7 @@ extension Client { method: ClientMethod = .get, header: ClientHeader = [:], timeout: Interval? = nil, - optionBlock: (inout URLRequest) -> Void = { _ in } + optionBlock: @escaping (inout URLRequest) -> Void = { _ in } ) -> Promise, Error> where RequestValue? == Request { request( url: url, @@ -48,7 +48,7 @@ extension Client { header: ClientHeader = [:], body: Request, timeout: Interval? = nil, - optionBlock: (inout URLRequest) -> Void = { _ in } + optionBlock: @escaping (inout URLRequest) -> Void = { _ in } ) -> Promise, Error> { request( url: url, diff --git a/Source/Network/Implement/Client/DataClient.swift b/Source/Network/Implement/Client/DataClient.swift index ac30a35..4a5199c 100644 --- a/Source/Network/Implement/Client/DataClient.swift +++ b/Source/Network/Implement/Client/DataClient.swift @@ -39,7 +39,7 @@ extension DataClient { header: ClientHeader = [:], body: Data? = nil, timeout: Interval? = nil, - optionBlock: (inout URLRequest) -> Void = { _ in } + optionBlock: @escaping (inout URLRequest) -> Void = { _ in } ) -> Promise, Error> { let pending = Promise, Error>.pending() diff --git a/Source/Network/Implement/Client/JSONClient.swift b/Source/Network/Implement/Client/JSONClient.swift index 57d4a5e..2201c0a 100644 --- a/Source/Network/Implement/Client/JSONClient.swift +++ b/Source/Network/Implement/Client/JSONClient.swift @@ -36,7 +36,7 @@ extension JSONClient { header: ClientHeader = [:], body: JSON? = nil, timeout: Interval? = nil, - optionBlock: (inout URLRequest) -> Void = { _ in } + optionBlock: @escaping (inout URLRequest) -> Void = { _ in } ) -> Promise, Error> { let header = header.merging([ "Content-Type": "application/json"