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

Provide property delegate mechanism for naming modules #393

Closed
dalewking opened this issue Dec 4, 2021 · 0 comments
Closed

Provide property delegate mechanism for naming modules #393

dalewking opened this issue Dec 4, 2021 · 0 comments

Comments

@dalewking
Copy link

dalewking commented Dec 4, 2021

Creating a module like this:

val fooModule = DI.Module("fooModule" ) { ... }

it occurs to me that is repetitive having to specify the name twice. It occurs to me with property delegates the delegate could get the name from the variable it is a delegate for. Ideally it would look like this:

val fooModule by DI.Module { ... }

Which unfortunately would clash with the deprecated unnamed module constructor so not sure if you can use this without invoking the deprecated constructor, but the proposal is to provide some mechanism to name the module via delegation.

Speaking of the deprecated module constructor, the quick start guide shows an example using this. If it is deprecated then you probably show not show it in the guide.

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