diff --git a/Sources/EasyDi.swift b/Sources/EasyDi.swift index 78c4be8..5f3ae0c 100644 --- a/Sources/EasyDi.swift +++ b/Sources/EasyDi.swift @@ -273,13 +273,10 @@ open class Assembly: AssemblyInternal { into initClosure: @autoclosure @escaping () -> ObjectType, inject injectClosure: ObjectInjectClosure? = nil ) { - let _: ObjectType = self.define( - key: key, - definitionKey: definitionKey, - scope: scope, - init: initClosure, - inject: injectClosure - ) + let _: ObjectType = define(key: key, definitionKey: definitionKey, scope: scope) { (definition:Definition) in + definition.initClosure = initClosure + definition.injectClosure = injectClosure + } } /// This method defines object, which will be initialized and injected by assembly.