Question about catchToEffect() deprecation #1999
Answered
by
mbrandonw
WedgeSparda
asked this question in
Q&A
-
Hi, I'm migrating our code base to
My context is like this:
I saw this other answer but couldn't figure out how to adapt it to my code. How should approach this change? Thanks. |
Beta Was this translation helpful? Give feedback.
Answered by
mbrandonw
Mar 23, 2023
Replies: 2 comments 6 replies
-
Hey @WedgeSparda! Maybe something like this: return .run { send in
for try await value in executeAPublisherThatCanFailAndReturnsVoid().values {
await send(.handleSuccessEffect)
}
} catch { _, send in
await send(.handleErrorEffect)
} |
Beta Was this translation helpful? Give feedback.
3 replies
-
@stephencelis's answer in that post should also help you: return .publisher {
executeAPublisherThatCanFailAndReturnsVoid()
.receive(on: mainQueue)
.map { .handleSuccessEffect }
.catch { _ in .handleErrorEffect }
} |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
WedgeSparda
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@stephencelis's answer in that post should also help you: