yattee/Shared/Views/SubscriptionsView.swift
2021-08-26 00:12:59 +02:00

25 lines
521 B
Swift

import SwiftUI
struct SubscriptionsView: View {
@ObservedObject private var store = Store<[Video]>()
var resource = InvidiousAPI.shared.feed
init() {
resource.addObserver(store)
}
var body: some View {
VideosView(videos: store.collection)
.onAppear {
resource.loadIfNeeded()
}
.refreshable {
resource.load()
}
#if !os(tvOS)
.navigationTitle("Subscriptions")
#endif
}
}