Does Anyone Know How to do Networking Effects with Combine in the TCA architecture ? #1233
Unanswered
Dominic263
asked this question in
Q&A
Replies: 2 comments 2 replies
-
@Dominic263 Looking at the JSON payload, I think the issue is you are trying to decode struct CatFactResponse: Decodable {
var data: [CatFact]
} Which you can use when you call A couple notes on debugging tips: If you call .print()
.replaceError(with: [...]) |
Beta Was this translation helpful? Give feedback.
0 replies
-
works like magic. Thanks, Stephen! |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi folks,
I am having a challenge when it comes to doing any networking using combine for my mock TCA app. I decided to learn TCA by actually building a project a few weeks ago but I am having issues with network effects. I am trying to fetch data from https://catfact.ninja/facts to display cat facts in the app, and I have somehow realized that there is an error happening because the replaceError(with: ) function is being invoked every time I fetch data.


This is how I modeled my Data as per the schema from the site I am trying to execute the get request.
and this is the snippet of code from my reducer which shows how I try to fetch data using URLSession
Is there something I am doing wrong here and if so how can I correct that? Thanks for your help and let me know if I should provide more information.
Beta Was this translation helpful? Give feedback.
All reactions