Skip to content

Instantly share code, notes, and snippets.

@lammertw
Created March 8, 2021 17:58
Show Gist options
  • Save lammertw/62990652095482065da0ea7f3d3bbdf7 to your computer and use it in GitHub Desktop.
Save lammertw/62990652095482065da0ea7f3d3bbdf7 to your computer and use it in GitHub Desktop.
struct RestaurantDetailView: View {
let viewModel: RestaurantDetailViewModel
var body: some View {
ObservingView(publisher: asPublisher(viewModel.output), content: InnerView.init)
}
}
private struct InnerView: View {
let output: RestaurantDetailViewModelOutput
var body: some View {
VStack {
Text(output.name)
Text(output.priceCategory)
// etc
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment