Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DIContainer conforming EnvironmentKey - can't find its usage #93

Open
vanjang opened this issue Feb 27, 2024 · 2 comments
Open

DIContainer conforming EnvironmentKey - can't find its usage #93

vanjang opened this issue Feb 27, 2024 · 2 comments

Comments

@vanjang
Copy link

vanjang commented Feb 27, 2024

Just wonder why DIContainer conforms EnvironmentKey in the project as I am not able to find its usage with EnviromentValues across the project. The projects builds fine with commenting EnvironmentKey. Could anyone explain? I don't have enough knowledge on EnvironmentKey therefore I may miss something on how to use it.

@Eirias
Copy link

Eirias commented Feb 27, 2024

Check the RootViewModifier on the master branch, it uses:
@Environment(\.injected) private var injected: DIContainer

which uses the
extension EnvironmentValues { var injected: DIContainer { get { self[DIContainer.self] } set { self[DIContainer.self] = newValue } } }

from the DependencyInjector.

@vanjang
Copy link
Author

vanjang commented Feb 27, 2024

Ah got it! I am on mvvm branch and it doesn't have the code you advised above. Thanks and problem solved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants