Multiple accounts scenarios with SessionStageContainer #5
daniele-pizziconi
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Thank you Alexey for the answer in the Issues section.
I'm combining some of the principles (e.g. AppEnvironment as Composition Root) shown in the SwiftUI-MVVM project with some others defined in this one (e.g. locks and keys) and what I have now it's basically one DependencyContainer that spawns 2 sub DI containers: LoginContainer and AccountContainer:
Then in the coordinator that deals those 2 flows, I create one or the other so I can inject it to the correspondent coordinator, like this
or
What do you think about this one so far?
Now I'd like to bring it to the next level: adding support for multi-account scenario, where
What's your suggestion on these ones?
I was thinking to have a component that keeps a map of
AccountDIContainer
which returns the correspondent DI container based on the account passed. But which is that component? The mainDIContainer
itself?That might solve the point 1, but I don't clearly see if that is going towards the right direction even for point 2.
Beta Was this translation helpful? Give feedback.
All reactions