create

inline suspend fun <T : Any> DependencyResolver.create(): T(source)

Creates an instance of the specified type T using the dependency resolver. This function uses the DependencyReflection mechanism to dynamically construct an instance of the requested type, resolving dependencies as needed.

Report a problem

Return

An instance of the type T.


inline suspend fun <T : Any> DependencyResolver.create(kClass: KClass<out T>): T(source)

Creates or retrieves an instance of the specified type T from the DependencyResolver. If the instance does not already exist, it is created using reflection.

Report a problem

Return

An instance of the specified type T.

Parameters

T

The type of the instance to be created or retrieved.

kClass

The class reference representing the type of object to create or retrieve.