Anatolii
(Lytvynenko)
1
Hello.
There is some common case when only after login you can use some API, so this class/struct dependents from some "logged in"-data and I want to create DependencyValues with this ApiClass, but I can't make "global"-initializer.
Also, I can't find any samples under "Point-Free · GitHub"
So, question, how can I do that? maybe someone have a samples.
Thank you.
otondin
(Gabriel Tondin)
2
Hi @Anatolii ! You can look at LoginCore feature within the Tic-Tac-Toe example project in the swift-composable-architecture repository. I hope it can help you!
Anatolii
(Lytvynenko)
3
Thank you for response, I saw it, but it not suitable for me, not answering on question how to build dependent dependency
otondin
(Gabriel Tondin)
4
@Anatolii what do you mean by "dependent dependency"?
Anatolii
(Lytvynenko)
5
@otondin
ApiClient(account: Account)
Account - not equitable
after auth I got Account and want to use:
@Dependency(.apiClient) var apiClient
otondin
(Gabriel Tondin)
6
1 Like
Anatolii
(Lytvynenko)
7
Thank you, @otondin
Will try