Skip to content

Conversation

@xsdc
Copy link
Owner

@xsdc xsdc commented Dec 3, 2024

No description provided.

Comment on lines +101 to 104
protocol RenderableProductView {
func render() -> [ComponentView]
}
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original code included a number of properties in this protocol that leaked implementation details. Removed them and updated render to return the array of [ComponentView] as it's cleaner.

Comment on lines 115 to 139
struct AppleWatchSummaryView: RenderableProductView {
private let product: Product
private let componentRenderer: ProductComponentRenderer

func render() -> [ComponentView] {
[
componentRenderer.renderTitleView(for: product),
componentRenderer.renderPriceView(for: product),
componentRenderer.renderCarouselView(for: product)
]
}
}

class CreditCardPaymentProvider: PaymentProvider {
func processPayment(amount: Double) async -> Result<String, Error> {
return .success("Visa payment succeeded.")
struct AppleWatchTechSpecsView: RenderableProductView {
private let product: Product
private let componentRenderer: ProductComponentRenderer

func render() -> [ComponentView] {
[
componentRenderer.renderTitleView(for: product),
componentRenderer.renderPriceView(for: product),
componentRenderer.renderTechSpecsView(for: product)
]
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed these concretions to structs, removed redundant private(set), and redundant inits.

@ryanbrear ryanbrear self-assigned this Oct 17, 2025
@ryanbrear ryanbrear merged commit 8861d23 into main Oct 21, 2025
@ryanbrear ryanbrear deleted the bridge branch October 24, 2025 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants