-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Generated modules are global #92
Comments
Is it ever necessary to reference the module outside of instantiating Koin/multiple times? If so, couldn't this proposal cause problems? I'm not certain that referencing a module multiple times is ever needed, so this may not actually cause any problems. |
I see 2 options for implementing a fix.
Either would work for me. With option 1 you can still create and use a global module that would be shared across multiple koin instances, you would just have to do it explicitly. |
Ok interesting 🤔 need to check the global impact of this |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
You're breaking my heart stale bot. |
duplicated with #102 |
Is your feature request related to a problem? Please describe.
I'm trying to create many instances of
KoinApplication
to use in tests that run in parallel. Currently this not possible because the generated module instances are set in global variables.For example, code like this:
Will generate code like this:
The
foo_ScanModule
keeps a single global instance of the module, which causes singletons to be shared among all koin instances created with this module.Describe the solution you'd like
I think calling
ScanModule.module
should create a new instance of the module each time.The text was updated successfully, but these errors were encountered: