yattee/Apple TV/SubscriptionsView.swift

19 lines
374 B
Swift
Raw Normal View History

2021-06-11 22:49:42 +00:00
import SwiftUI
struct SubscriptionsView: View {
2021-06-28 10:43:07 +00:00
@ObservedObject private var store = Store<[Video]>()
2021-06-26 11:37:24 +00:00
2021-06-28 10:43:07 +00:00
var resource = InvidiousAPI.shared.subscriptions
2021-06-11 22:49:42 +00:00
2021-06-28 10:43:07 +00:00
init() {
resource.addObserver(store)
}
2021-06-26 11:37:24 +00:00
2021-06-28 10:43:07 +00:00
var body: some View {
VideosView(videos: store.collection)
.onAppear {
resource.loadIfNeeded()
}
2021-06-11 22:49:42 +00:00
}
}