mirror of
https://github.com/yattee/yattee.git
synced 2024-11-10 00:08:21 +00:00
25 lines
465 B
Swift
25 lines
465 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 {
|
|
VideosListView(videos: store.collection)
|
|
.onAppear {
|
|
resource.loadIfNeeded()
|
|
}
|
|
}
|
|
}
|