Skip to content

Instantly share code, notes, and snippets.

@Rasalexman
Created May 18, 2020 16:53
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/811a8a8dee3c37909a9f2b4e1a475181 to your computer and use it in GitHub Desktop.
Save Rasalexman/811a8a8dee3c37909a9f2b4e1a475181 to your computer and use it in GitHub Desktop.
Scope example
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