This repository has been archived by the owner on Sep 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into main
- Loading branch information
Showing
19 changed files
with
138 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
Sources/Legatus/RequestPublishers/DataRequestPublisher.swift
This file was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
Sources/Legatus/ResponsePublishers/DataResponsePublisher.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import Alamofire | ||
import Combine | ||
import Foundation | ||
|
||
public struct DataResponsePublisher: Publisher { | ||
public typealias Output = APIResponse | ||
public typealias Failure = Error | ||
|
||
private let apiClient: APIClient? | ||
private let apiRequest: APIRequest | ||
|
||
init(apiClient: APIClient?, apiRequest: APIRequest) { | ||
self.apiClient = apiClient | ||
self.apiRequest = apiRequest | ||
} | ||
|
||
public func receive<S: Subscriber>(subscriber: S) where Failure == S.Failure, Output == S.Input { | ||
guard let apiClient = apiClient else { return } | ||
let dataRequestSubscription = DataResponseSubscription( | ||
subscriber: subscriber, | ||
apiClient: apiClient, | ||
apiRequest: apiRequest) | ||
|
||
subscriber.receive(subscription: dataRequestSubscription) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.