Created
May 18, 2020 16:53
-
-
Save Rasalexman/811a8a8dee3c37909a9f2b4e1a475181 to your computer and use it in GitHub Desktop.
Scope example
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
interface IProviderInterface | |
data class ProviderClass(override val id: String, override val name: String = "Provider") : IProviderInterface | |
val MY_PROVIDER_SCOPE_NAME = "MY_PROVIDER_SCOPE_NAME" | |
kodi { | |
bind<IProviderInterface>() at MY_PROVIDER_SCOPE_NAME with provider { ProviderClass(UUID.randomUUID().toString()) } | |
} | |
val providerInstaceByScope = instance<IProviderInterface>(scope = MY_PROVIDER_SCOPE_NAME) | |
println("providerInstaceByScope id = ${providerInstaceByScope.id}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment