Add stubs for fetching articles for starred and today feeds.
This commit is contained in:
parent
863de80281
commit
3e60f929a2
|
@ -11,7 +11,7 @@ import RSCore
|
|||
import Data
|
||||
import Account
|
||||
|
||||
protocol SmartFeedDelegate: DisplayNameProvider {
|
||||
protocol SmartFeedDelegate: DisplayNameProvider, ArticleFetcher {
|
||||
|
||||
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 {
|
||||
|
||||
// MARK: - Unread Counts
|
||||
|
|
|
@ -19,4 +19,18 @@ struct StarredFeedDelegate: SmartFeedDelegate {
|
|||
|
||||
account.fetchUnreadCountForStarredArticles(callback)
|
||||
}
|
||||
|
||||
// MARK: ArticleFetcher
|
||||
|
||||
func fetchArticles() -> Set<Article> {
|
||||
|
||||
// TODO
|
||||
return Set<Article>()
|
||||
}
|
||||
|
||||
func fetchUnreadArticles() -> Set<Article> {
|
||||
|
||||
return fetchArticles().unreadArticles()
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -18,5 +18,18 @@ struct TodayFeedDelegate: SmartFeedDelegate {
|
|||
|
||||
account.fetchUnreadCountForToday(callback)
|
||||
}
|
||||
|
||||
// MARK: ArticleFetcher
|
||||
|
||||
func fetchArticles() -> Set<Article> {
|
||||
|
||||
// TODO
|
||||
return Set<Article>()
|
||||
}
|
||||
|
||||
func fetchUnreadArticles() -> Set<Article> {
|
||||
|
||||
return fetchArticles().unreadArticles()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue