NetNewsWire/Shared/SmartFeeds/SmartFeedDelegate.swift

35 lines
795 B
Swift
Raw Normal View History

//
// SmartFeedDelegate.swift
// NetNewsWire
//
// Created by Brent Simmons on 6/25/19.
// Copyright © 2019 Ranchero Software. All rights reserved.
//
import Foundation
import Account
import Articles
import ArticlesDatabase
2024-03-11 02:17:04 +01:00
import Database
import Core
protocol SmartFeedDelegate: SidebarItemIdentifiable, DisplayNameProvider, ArticleFetcher, SmallIconProvider {
2024-03-19 05:08:37 +01:00
2024-03-25 20:48:02 +01:00
@MainActor var fetchType: FetchType { get }
2024-03-19 05:08:37 +01:00
2024-03-25 20:48:02 +01:00
@MainActor func unreadCount(account: Account) async -> Int
}
extension SmartFeedDelegate {
2024-03-19 05:08:37 +01:00
@MainActor func fetchArticles() async throws -> Set<Article> {
try await AccountManager.shared.fetchArticles(fetchType: fetchType)
}
2024-03-19 05:08:37 +01:00
@MainActor func fetchUnreadArticles() async throws -> Set<Article> {
try await AccountManager.shared.fetchArticles(fetchType: fetchType)
}
}