From ca76092529b99ce6aa663238eff986c5034f7c97 Mon Sep 17 00:00:00 2001 From: Mohammed Rokon Uddin Date: Fri, 9 Feb 2024 16:51:55 +0600 Subject: [PATCH] chore: remove commented codes --- .../Common/Sources/Common/BaseAction.swift | 22 ----------------- .../Network/NetworkingType.swift | 24 ------------------- 2 files changed, 46 deletions(-) delete mode 100644 {{cookiecutter.app_name}}/Common/Sources/Common/BaseAction.swift diff --git a/{{cookiecutter.app_name}}/Common/Sources/Common/BaseAction.swift b/{{cookiecutter.app_name}}/Common/Sources/Common/BaseAction.swift deleted file mode 100644 index 3a60272..0000000 --- a/{{cookiecutter.app_name}}/Common/Sources/Common/BaseAction.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// BaseAction.swift -// Common -// -// Created by {{ cookiecutter.creator }} on {% now 'utc', '%d/%m/%Y' %}. -// Copyright © {% now 'utc', '%Y' %} {{cookiecutter.company_name}}. All rights reserved. -// - -import Foundation - -// keep Actions organized and their intent explicit -// https://github.com/pointfreeco/swift-composable-architecture/discussions/1440 - -public protocol BaseAction { - associatedtype ViewAction - associatedtype DelegateAction - associatedtype InlyingAction - - static func view(_: ViewAction) -> Self - static func delegate(_: DelegateAction) -> Self - static func inlying(_: InlyingAction) -> Self -} diff --git a/{{cookiecutter.app_name}}/NetworkPlatform/Sources/NetworkPlatform/Network/NetworkingType.swift b/{{cookiecutter.app_name}}/NetworkPlatform/Sources/NetworkPlatform/Network/NetworkingType.swift index 757f50b..388d844 100644 --- a/{{cookiecutter.app_name}}/NetworkPlatform/Sources/NetworkPlatform/Network/NetworkingType.swift +++ b/{{cookiecutter.app_name}}/NetworkPlatform/Sources/NetworkPlatform/Network/NetworkingType.swift @@ -57,30 +57,6 @@ extension NetworkingType { } } } - - // func requestObject(_ target: T, type: Element.Type) -> AnyPublisher { - // return provider.request(target) - // .filterSuccessfulStatusCodes() - // .map(Element.self) - // .mapError { NetworkingError.error($0.localizedDescription) } - // // TODO: fetch from cache - // .tryCatch { _ in self.coreDataManager.localRandom() } - // .mapError { NetworkingError.error($0.localizedDescription) } - // .eraseToAnyPublisher() - // } - - func requestArray(_ target: T, type _: Element.Type) - -> AnyPublisher<[Element], NetworkingError> - { - provider.request(target) - .filterSuccessfulStatusCodes() - .map([Element].self) - .mapError { NetworkingError.error($0.localizedDescription) } - // TODO: fetch from cache - // .tryCatch { _ in self.coreDataManager.localRandom() } - .mapError { NetworkingError.error($0.localizedDescription) } - .eraseToAnyPublisher() - } } // MARK: - Provider support