createInjector

open override fun <T : Any> createInjector(identifier: Identifier<T>, onInjection: (T) -> Unit): Injector<T>

Creates an Injector that can be used as a property delegator, bound against the given identifier.

Parameters

T

The injected component's type

identifier

The identifier to create an injector for

onInjection

Callback that must be called whenever the injection occurs. This is used for debugging and testing purposes. Note that an injection only happens when the environment is actually queried for an object. Because of this, eager and lazy injection only actually perform the injection once, while active injection always performs an injection.