koin-core / org.koin.core.scope / Scope / declare

declare

fun <reified T : Any> declare(instance: T, qualifier: Qualifier? = null, secondaryTypes: List<KClass<*>>? = null, override: Boolean = false): <ERROR CLASS>

Declare a component definition from the given instance This result of declaring a scoped/single definition of type T, returning the given instance (single definition of the current scope is root)

Parameters

instance - The instance you're declaring.

qualifier - Qualifier for this declaration

secondaryTypes - List of secondary bound types

override - Allows to override a previous declaration of the same type (default to false).