TCA migration questions and some experiences from 0.54 to 1.0 #2345
marcuswu0814
started this conversation in
General
Replies: 1 comment
-
Hi @marcuswu0814, thank you for writing this up to share with everyone. I will say, though, that we highly recommended people upgrade to 0.58.0 before going to 1.0. That would have helped catch most of these things as simpler deprecation warnings rather than hard, incomprehensible errors. |
Beta Was this translation helpful? Give feedback.
0 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.
Uh oh!
There was an error while loading. Please reload this page.
-
If someone like me wanna find some guide to migrate to
1.0
version, it’s some of my experiences when I adapt to my projects.Also had some questions in sections if someone can share your advices, really thanks for that!
1. Replace
ReducerProtocol
withReducer
2. Replace
EffectTask
withEffect
3. Using closure base api for init a
Store
From:
To:
4. Sending action to
Store
immediatelyIn past time we need to send action to a
ViewStore
although you didn’t need observe any changes.In 1.0, you just need to send the action to
Store
.From:
To:
5. @BindableState to @BindingState
Replace all
@BindableState
to@BindingState
in yourState
struct.In your view, your need to change binding syntax
From:
To:
6. Loose coupling of
Combine
Lots of feature be replace with Swift Concurrency with
async/await
, if your API is still usingPublisher
, you can follow the tip and it still work, if you need theeraseToEffect()
orcatchToEffect()
, just adding the extension back for your situation.In my case, my API using
RxSwift
’sSingle
trait and I using the follow extension work withEffect
:The
publisher
property ofSingle
if from RxCombine.I’m not sure is all of my change is best practice or correctly, if there had any problems, please feel free to let me know, and also glad to your sharing!
Beta Was this translation helpful? Give feedback.
All reactions