yattee/Apple TV/ChannelView.swift
2021-07-08 00:54:35 +02:00

25 lines
461 B
Swift

import Siesta
import SwiftUI
struct ChannelView: View {
@ObservedObject private var store = Store<[Video]>()
var id: String
var resource: Resource {
InvidiousAPI.shared.channelVideos(id)
}
init(id: String) {
self.id = id
resource.addObserver(store)
}
var body: some View {
VideosView(videos: store.collection)
.onAppear {
resource.loadIfNeeded()
}
}
}