-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
.DS_Store | ||
*.xcodeproj | ||
.swiftpm/ | ||
.swiftpm/* | ||
*.xcodeproj | ||
!Followers.xcodeproj | ||
/.build | ||
/Packages | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// | ||
// Receivables+Once.swift | ||
// ComposableRequest | ||
// | ||
// Created by Stefano Bertagno on 27/08/21. | ||
// | ||
|
||
import Foundation | ||
|
||
public extension Receivables { | ||
/// A `struct` defining a `Requester`-based receivable | ||
/// receiving immediately either a success or failure. | ||
struct Once<Requester: Requests.Requester, Success>: Receivable { | ||
/// The underlying result. | ||
public let result: Result<Success, Error> | ||
|
||
/// Init. | ||
/// | ||
/// - parameters: | ||
/// - success: A valid `Success`. | ||
/// - requester: A valid `Requester`. | ||
public init(output success: Success, with requester: Requester) { | ||
self.result = .success(success) | ||
} | ||
|
||
/// Init. | ||
/// | ||
/// - parameters: | ||
/// - failure: A valid `Error`. | ||
/// - requester: A valid `Requester`. | ||
public init(error failure: Error, with requester: Requester) { | ||
self.result = .failure(failure) | ||
} | ||
} | ||
} | ||
|
||
public extension Requester { | ||
/// The associated once type. | ||
typealias Once<S> = Receivables.Once<Self, S> | ||
} |
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
16 changes: 0 additions & 16 deletions
16
Sources/Requests/Requester/Completion/URLSessionCompletionValue.swift
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.