import Foundation import Observation /// The web dashboard contract — attention queues, open work, pins, and /// recent activity — in one `dashboard` read. This replaced a per-repo fan-out that /// drained the rate bucket at 64 of 66 repos; krz/gitbay#41 added the /// aggregate. @Observable @MainActor final class DashboardViewModel { private(set) var state: LoadState = .loading private let client: GitbayClient init(client: GitbayClient) { self.client = client } func load() async { do { state = .loaded(try await client.read(["dashboard"], as: DashboardData.self)) } catch { state = .from(error) } } }