Last active
January 5, 2023 11:28
-
-
Save siddheshredkar/0ad861b9fd942c7e44b5afdd962312b7 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
class FeedStore: FeedService { | |
static let shared = FeedStore() | |
private init() {} | |
func fetchFeeds(from endpoint: FeedListEndpoint, completion: @escaping (Result<Feed, APIError>) -> ()) { | |
print("\(APIPath().feed)\(endpoint.rawValue)") | |
guard let url = URL(string: "\(APIPath().feed)\(endpoint.rawValue)") else { | |
completion(.failure(.invalidEndpoint)) | |
return | |
} | |
print(url) | |
BaseAPIManager.shared.loadURLAndDecode(url: url, completion: completion) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment