diff --git a/LeadKitAdditions/Sources/Extensions/Observable+Extensions.swift b/LeadKitAdditions/Sources/Extensions/Observable+Extensions.swift index 7c67157..5df91f9 100644 --- a/LeadKitAdditions/Sources/Extensions/Observable+Extensions.swift +++ b/LeadKitAdditions/Sources/Extensions/Observable+Extensions.swift @@ -29,7 +29,7 @@ public typealias VoidBlock = () -> Void public extension Observable { /// Handles connection errors during request - public func handleConnectionErrors() -> Observable { + func handleConnectionErrors() -> Observable { return observeOn(CurrentThreadScheduler.instance) // handle no internet connection @@ -60,7 +60,7 @@ public extension Observable { - errorTypes: list of error types, which triggers request restart - retryLimit: how many times request can restarts */ - public func retryWithinErrors(_ errorTypes: [Error.Type] = [ConnectionError.self], + func retryWithinErrors(_ errorTypes: [Error.Type] = [ConnectionError.self], retryLimit: Int = DefaultNetworkService.retryLimit) -> Observable { @@ -81,7 +81,7 @@ public extension Observable { - apiErrorType: type of errors, received frim server - handler: block, that executes, when error occured */ - public func handleApiError(_ apiErrorType: T, + func handleApiError(_ apiErrorType: T, handler: @escaping () -> Void) -> Observable where T.RawValue == Int { @@ -98,7 +98,7 @@ public extension Observable { - parameter isLoading: subject, request state bind to */ - public func changeLoadingBehaviour(isLoading: PublishSubject) -> Observable { + func changeLoadingBehaviour(isLoading: PublishSubject) -> Observable { return observeOn(CurrentThreadScheduler.instance) .do(onNext: { _ in isLoading.onNext(false) diff --git a/LeadKitAdditions/Sources/Extensions/UserDefaults+UserService.swift b/LeadKitAdditions/Sources/Extensions/UserDefaults+UserService.swift index 4015847..6ca694f 100644 --- a/LeadKitAdditions/Sources/Extensions/UserDefaults+UserService.swift +++ b/LeadKitAdditions/Sources/Extensions/UserDefaults+UserService.swift @@ -30,7 +30,7 @@ private enum Keys { public extension UserDefaults { /// Default place to store session id - public var sessionId: String? { + var sessionId: String? { get { return string(forKey: Keys.sessionId) } @@ -40,7 +40,7 @@ public extension UserDefaults { } /// Default place to store userLogin - public var userLogin: String? { + var userLogin: String? { get { return string(forKey: Keys.userLogin) }