Replies: 1 comment 3 replies
-
I think AsyncStream.materialize to reuse RxSwift terminology would more fitting. It is a bit misleading letting the func be on TaskResult. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Building on the discussion in #1847, here's an idea for improving the ergonomics of using a
TaskResult
with anAsyncThrowingStream
Given this client endpoint and domain action:
Current approach to iterating over a throwing async stream. Requires adding the
catch
block torun
, which isn't typically needed when sending a single throwing action by usingTaskResult(catching:)
Proposal
Introduce
TaskResult.map
that transforms a throwing stream into a non-throwing streamPOC implementation
Worth PRing? Happy to take this further if there's interest.
Beta Was this translation helpful? Give feedback.
All reactions