import SwiftUI
struct ContentView: View { @StateObject private var vm = PetsListViewModel
init(){
_vm = StateObject(wrappedValue: PetsListViewModel(service: Webservice()))
}
var body: some View {
NavigationView {
ScrollView {
ForEach(vm.components, id:\.uniqueId
){ component in component.render()
}
.navigationTitle("Pets")
}.task {
await vm.load()
}
}
}
}