Skip to content

Instantly share code, notes, and snippets.

@Rasalexman
Last active May 13, 2020 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rasalexman/38bcafa3c7b9eb88fda05e565e25f592 to your computer and use it in GitHub Desktop.
Save Rasalexman/38bcafa3c7b9eb88fda05e565e25f592 to your computer and use it in GitHub Desktop.
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