Add stubs for fetching articles for starred and today feeds.

This commit is contained in:
Brent Simmons 2018-02-10 13:22:02 -08:00
parent 863de80281
commit 3e60f929a2
3 changed files with 41 additions and 1 deletions

View File

@ -11,7 +11,7 @@ import RSCore
import Data import Data
import Account import Account
protocol SmartFeedDelegate: DisplayNameProvider { protocol SmartFeedDelegate: DisplayNameProvider, ArticleFetcher {
func fetchUnreadCount(for: Account, callback: @escaping (Int) -> Void) func fetchUnreadCount(for: Account, callback: @escaping (Int) -> Void)
} }
@ -51,6 +51,19 @@ final class SmartFeed: PseudoFeed {
} }
} }
extension SmartFeed: ArticleFetcher {
func fetchArticles() -> Set<Article> {
return delegate.fetchArticles()
}
func fetchUnreadArticles() -> Set<Article> {
return delegate.fetchUnreadArticles()
}
}
private extension SmartFeed { private extension SmartFeed {
// MARK: - Unread Counts // MARK: - Unread Counts

View File

@ -19,4 +19,18 @@ struct StarredFeedDelegate: SmartFeedDelegate {
account.fetchUnreadCountForStarredArticles(callback) account.fetchUnreadCountForStarredArticles(callback)
} }
// MARK: ArticleFetcher
func fetchArticles() -> Set<Article> {
// TODO
return Set<Article>()
}
func fetchUnreadArticles() -> Set<Article> {
return fetchArticles().unreadArticles()
}
} }

View File

@ -18,5 +18,18 @@ struct TodayFeedDelegate: SmartFeedDelegate {
account.fetchUnreadCountForToday(callback) account.fetchUnreadCountForToday(callback)
} }
// MARK: ArticleFetcher
func fetchArticles() -> Set<Article> {
// TODO
return Set<Article>()
}
func fetchUnreadArticles() -> Set<Article> {
return fetchArticles().unreadArticles()
}
} }