We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This follows a use case defined in #384.
Provided and interface I implemented by a class C, if I want to bind C, and have a binding I that delegates to the C binding, I must write:
I
C
bind { singleton { C() } } bind<I> { provider { instance<C>() } }
This second line is not immediately understandable and requires some mental gymnastic to understand what is a simple delegation.
I propose the following DSL to make this usecase easier to read:
bind { singleton { C() } } bind<I> { sameAs<C>() }
The text was updated successfully, but these errors were encountered:
feat(#406): provide the delegation binding
244579d
final syntax is
interface ICache class Cache : ICache val di = DI { bind { singleton { Cache() } } // Bind concrete type delegate<ICache>().to<Cache>() // Delegate binding to concrete bound type }
Sorry, something went wrong.
No branches or pull requests
This follows a use case defined in #384.
Provided and interface
I
implemented by a classC
, if I want to bindC
, and have a bindingI
that delegates to theC
binding, I must write:This second line is not immediately understandable and requires some mental gymnastic to understand what is a simple delegation.
I propose the following DSL to make this usecase easier to read:
The text was updated successfully, but these errors were encountered: