Created
March 15, 2022 19:28
-
-
Save malcommac/74ed5eae051a2bf321fde8c19cc9b49e to your computer and use it in GitHub Desktop.
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
public extension HTTPClient { | |
func fetch<T: APIResourceConvertible>(_ convertible: T) async throws -> T.Result { | |
let result = try await fetch(convertible.request()) | |
return try result.decode(T.Result.self) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment