Skip to content

Commit 142d6c7

Browse files
committed
add header transform shorthand
trying out the entire signature everytime in the ios branch is making my fingers ache
1 parent 6fba564 commit 142d6c7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Source/LDSwiftEventSource.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import FoundationNetworking
88
import os.log
99
#endif
1010

11+
typealias HeaderTransform = ([String: String]) -> [String: String]
12+
1113
public class EventSource {
1214
private let esDelegate: EventSourceDelegate
1315

@@ -56,7 +58,7 @@ public class EventSource {
5658
/// Additional headers to be set on the request
5759
public var headers: [String: String] = [:]
5860
/// Provides the ability to add conditional headers
59-
public var extraHeaders: ([String: String]) -> [String: String] = { $0 }
61+
public var extraHeaders: HeaderTransform = { $0 }
6062
/// The minimum amount of time to wait before reconnecting after a failure
6163
public var reconnectTime: TimeInterval = 1.0
6264
/// The maximum amount of time to wait before reconnecting after a failure

0 commit comments

Comments
 (0)