Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#515] Remove all Rx things #525

Merged
merged 4 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions Tuist/Interfaces/UIKit/Project/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ inhibit_all_warnings!
def testing_pods
pod 'Quick'
pod 'Nimble'
pod 'RxNimble', subspecs: ['RxBlocking', 'RxTest']
pod 'RxSwift'
pod 'Sourcery'
pod 'SwiftFormat/CLI'
end
Expand All @@ -16,11 +14,9 @@ target '{PROJECT_NAME}' do
pod 'Kingfisher'
pod 'SnapKit'

# Rx
pod 'RxAlamofire'
pod 'RxCocoa'
pod 'RxDataSources'
pod 'RxSwift'
# Backend
pod 'Alamofire'
pod 'JSONAPIMapper', :git => 'https://github.com/nimblehq/JSONMapper', :tag => '1.1.1'

# Storage
pod 'KeychainAccess'
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Empty file.
Empty file.
24 changes: 0 additions & 24 deletions Tuist/Interfaces/UIKit/Sources/Data/NetworkAPI/NetworkAPI.swift

This file was deleted.

Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
//

import Alamofire
import Combine

protocol NetworkAPIProtocol {

func performRequest<T: Decodable>(
_ configuration: RequestConfiguration,
for type: T.Type
) -> AnyPublisher<T, AFError>
) async throws -> T
}

extension NetworkAPIProtocol {
Expand All @@ -19,16 +18,16 @@ extension NetworkAPIProtocol {
session: Session,
configuration: RequestConfiguration,
decoder: JSONDecoder
) -> AnyPublisher<T, AFError> {
return session.request(
) async throws -> T {
try await session.request(
configuration.url,
method: configuration.method,
parameters: configuration.parameters,
encoding: configuration.encoding,
headers: configuration.headers,
interceptor: configuration.interceptor
)
.publishDecodable(type: T.self, decoder: decoder)
.value()
.serializingDecodable(T.self)
.value
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//

import Alamofire
import Combine

final class NetworkAPI: NetworkAPIProtocol {

Expand All @@ -16,8 +15,8 @@ final class NetworkAPI: NetworkAPIProtocol {
func performRequest<T: Decodable>(
_ configuration: RequestConfiguration,
for type: T.Type
) -> AnyPublisher<T, AFError> {
request(
) async throws -> T {
try await request(
session: Session(),
configuration: configuration,
decoder: decoder
Expand Down