Skip to content

Instantly share code, notes, and snippets.

@siddheshredkar
Last active January 5, 2023 11:28
Show Gist options
  • Save siddheshredkar/0ad861b9fd942c7e44b5afdd962312b7 to your computer and use it in GitHub Desktop.
Save siddheshredkar/0ad861b9fd942c7e44b5afdd962312b7 to your computer and use it in GitHub Desktop.
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