You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publicprotocolFactoryModule:Module{/// A factory for `Self`.associatedtypeFactory=Pure.Factory<Self>/// Creates an instance of a module with a dependency and a payload.init(dependency:Dependency, payload:Payload)}
openclassFactory<Module:FactoryModule>{privateletdependencyClosure:()->Module.Dependency/// A static dependency of a module.openvardependency:Module.Dependency{returnself.dependencyClosure()}/// Creates an instance of `Factory`.////// - parameter dependency: A static dependency which should be resolved in a composition root.publicinit(dependency:@autoclosure@escaping()->Module.Dependency){self.dependencyClosure = dependency
}/// Creates an instance of a module with a runtime parameter.////// - parameter payload: A runtime parameter which is required to construct a module.openfunc create(payload:Module.Payload)->Module{returnModule.init(dependency:self.dependency, payload: payload)}}
From https://github.com/devxoul/Pure/blob/master/Sources/Pure/FactoryModule.swift
From https://github.com/devxoul/Pure/blob/master/Sources/Pure/Factory.swift
From https://github.com/devxoul/Pure/blob/master/Tests/PureTests/PureSpec.swift#L72
The text was updated successfully, but these errors were encountered: