What's the best practices for managing static strings in TCA #3088
Unanswered
PatrickSCLin
asked this question in
Q&A
Replies: 1 comment
-
Hi @PatrickSCLin, I think you would need to share more details of exactly what kind of static strings you are storing and exactly what the code looks like to do so. To be honest, I've never really heard of people storing static strings in a "view model". I'm not sure what the purpose would be. If the strings are truly static, then is there any harm in just accessing them globally? |
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
-
Hi everyone,
I'm currently working on a project using The Composable Architecture (TCA) and I'm seeking advice on the best practices for managing static strings in this architecture. In traditional MVVM architecture, we typically place all the view strings in the ViewModel, which allows for centralized management and easy maintenance.
However, I'm not entirely sure what the equivalent approach in TCA should be. Given TCA's structure, where state, actions, and reducers are clearly separated, I'm looking for guidance on where static strings should reside to maintain clarity and ease of maintenance.
Specifically, I'd like to know:
Should static strings be included in the state, even if they do not change?
Is there a preferred way to manage these strings to maintain the benefits of TCA, such as clear state management and testability?
Are there any examples or patterns that the community recommends for handling this scenario?
Any insights, suggestions, or examples would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions