Last active
May 13, 2020 19:05
-
-
Save Rasalexman/38bcafa3c7b9eb88fda05e565e25f592 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object CustomObject { | |
@BindSingle(toClass = IAnotherClass::class) | |
fun providingMethod( | |
@WithInstance(with = "IAnotherClass::class") input: IMyClass | |
): IAnotherClass { | |
return input | |
} | |
} | |
//It is generate `Singleton` method for binding like: | |
val mainModule = KodiModule { | |
bind<IAnotherClass>() with single { CustomObject.providingMethod(input = instance<IAnotherClass>()) } | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment