addInjectable

open override fun <T : Any> addInjectable(instance: T, type: KClass<out T>, environment: String?)

This method allows to add an injectable instance at runtime. No scopes are defined here, as you are supposed to manually control it by addInjectable/removeInjectable

Parameters

instance

Is the instance you would like to be injectable. It will be injectable through instance::class only

type

Is the type of the instance. If no value is passed, the instance type will be taken For example, if A1:A2, by default A1 is injectable, with this parameter you can define A2 to be the injectable type

environment

The specific environment to be injected to. If null, will be injectable by all environments