provideDelegate
inline operator fun <T> provideDelegate(thisRef: Any?, prop: KProperty<*>): ReadOnlyProperty<Any?, T>(source)
Provides a delegated property for accessing a dependency from a DependencyRegistry. This operator function allows property delegation, ensuring the required dependency is registered and retrievable through the registry.
Example usage:
val repository: Repository<Message> by dependencies
Content copied to clipboard
Return
A ReadOnlyProperty that provides access to the resolved dependency of type T.
Parameters
thisRef
The receiver to which the property is being delegated. This parameter is not used in the actual implementation.
prop
The property for which the delegate is being requested.
Throws
If the dependency required by prop is not resolvable during access.