Replies: 2 comments 8 replies
-
Hi @sergdort, using I will also say that the other two styles you have sketched out are not recommended. The first, the one that uses the implicitly unwrapped optional, will not work because upon first access of a dependency it is cached. So you run the risk of caching the |
Beta Was this translation helpful? Give feedback.
-
Thanks, @mbrandonw ! Would it be correct to set a service in a runtime via DependencyValues.live.userSessionServices = UserSessionService(userData: userData) |
Beta Was this translation helpful? Give feedback.
-
Hey guys! Thanks for your hard work!
I'm researching of ways to migrate from TCA Environment based dependencies to the new solution. And in many places of our app we have services that need runtime data to be usable. For example we've got a
UserConfigService
that needsUserData
that we get from our server after successful sign in e.gIs there a more elegant solution that you would suggest? Because mine looks something like
or
I've seen in other treads people suggested to use nested
Dependency
wrappers like:Would love to hear your thoughts on that!
Beta Was this translation helpful? Give feedback.
All reactions