feat: Updates to using ResultView to handle errors.

This commit is contained in:
2026-01-10 20:14:59 -05:00
parent 20065ebf10
commit 1446540109
3 changed files with 250 additions and 124 deletions

View File

@@ -54,6 +54,17 @@ extension ResultView {
Styleguide.ErrorView(error: error)
}
}
public init(
catching: @escaping @Sendable () async throws(E) -> V,
) async where ErrorView == Styleguide.ErrorView<E>, V == Void, ValueView == EmptyHTML {
await self.init(
result: .init(catching: catching),
onSuccess: { EmptyHTML() }
) { error in
Styleguide.ErrorView(error: error)
}
}
}
extension ResultView: Sendable where Error: Sendable, ValueView: Sendable, ErrorView: Sendable {}