Skip to content

Commit

Permalink
Simplified Configuration initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
rwbutler committed Feb 21, 2023
1 parent 76524cc commit bb01b20
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions Hyperconnectivity/Classes/Model/Configuration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,15 @@ public struct HyperconnectivityConfiguration {
successThreshold: Percentage = Percentage(50.0),
urlSessionConfiguration: URLSessionConfiguration = Self.defaultURLSessionConfiguration
) {
let defaultValidator = ResponseStringValidator(
validationMode: .containsExpectedResponseString
self.init(
callbackQueue: callbackQueue,
connectivityQueue: connectivityQueue,
connectivityURLRequests: connectivityURLs.map { URLRequest(url: $0) },
responseValidator: responseValidator,
shouldCheckConnectivity: shouldCheckConnectivity,
successThreshold: successThreshold,
urlSessionConfiguration: urlSessionConfiguration
)
self.callbackQueue = callbackQueue
self.connectivityQueue = connectivityQueue
self.connectivityURLRequests = connectivityURLs.map { URLRequest(url: $0) }
self.responseValidator = responseValidator ?? defaultValidator
self.shouldCheckConnectivity = shouldCheckConnectivity
self.successThreshold = successThreshold
self.urlSessionConfiguration = urlSessionConfiguration
}

public init(
Expand Down

0 comments on commit bb01b20

Please sign in to comment.