// // ArticleFetcher.swift // Account // // Created by Brent Simmons on 2/4/18. // Copyright © 2018 Ranchero Software, LLC. All rights reserved. // import Foundation import Data public protocol ArticleFetcher { func fetchArticles() -> Set
func fetchUnreadArticles() -> Set
} extension Feed: ArticleFetcher { public func fetchArticles() -> Set
{ guard let account = account else { assertionFailure("Expected feed.account, but got nil.") return Set
() } return account.fetchArticles(for: self) } public func fetchUnreadArticles() -> Set
{ guard let account = account else { assertionFailure("Expected feed.account, but got nil.") return Set
() } return account.fetchUnreadArticles(for: self) } } extension Folder: ArticleFetcher { public func fetchArticles() -> Set
{ return fetchUnreadArticles() } public func fetchUnreadArticles() -> Set
{ guard let account = account else { assertionFailure("Expected folder.account, but got nil.") return Set
() } return account.fetchArticles(folder: self) } }