create

open suspend override fun <T : Any> create(kClass: KClass<T>, init: suspend (DependencyKey) -> Any): T(source)

Creates a new instance of the specified class using the provided initialization logic.

Report a problem

Return

A new instance of the specified class.

Parameters

T

The type of the instance to be created.

kClass

The class reference for the type of object to instantiate.

init

A lambda function that resolves dependencies required for the object creation using a DependencyKey.