You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/ComposableArchitecturePattern/Server+API.swift
+6-5Lines changed: 6 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ import Foundation
9
9
10
10
/// An object that specifies a specific server API.
11
11
///
12
-
/// - Note: It is highly encouraged to define your `supportedReturnObjects` to ensure `-supports<T: Codable>(_:)` is able to automatically verify against this.
12
+
/// - Note: It is highly encouraged to define your `supportedReturnObjects` to ensure `-supports<T: Decodable>(_:)` is able to automatically verify against this.
13
13
publicprotocolServerAPI:Identifiable,Equatable{
14
14
/// The environment this API should be used against. Default is `nil`.
15
15
/// - Note: If it can be used against any environment, leave it `nil`.
@@ -33,7 +33,7 @@ public protocol ServerAPI: Identifiable, Equatable {
33
33
/// All the return objects this API supports. Default is `nil`.
34
34
///
35
35
/// This helps ensure a non-supported object isn't attempted to be used with the API.
36
-
varsupportedReturnObjects:[Codable.Type]?{get}
36
+
varsupportedReturnObjects:[Decodable.Type]?{get}
37
37
38
38
/// The timeout length for the request. Default is `60`.
39
39
vartimeoutInterval:TimeInterval{get}
@@ -49,8 +49,9 @@ public protocol ServerAPI: Identifiable, Equatable {
49
49
func supports<T:Decodable>(_ object:T.Type)->Bool
50
50
}
51
51
52
-
extensionSequencewhere Element ==Codable.Type{
53
-
func isEqual(to other:[Codable.Type])->Bool{
52
+
extensionSequencewhere Element ==Decodable.Type{
53
+
/// Whether the given collection of decodable types is equal to this collection of decodable types.
54
+
func isEqual(to other:[Decodable.Type])->Bool{
54
55
self.contains(where:{ type in other.contains(where:{ $0 == type })})
0 commit comments