File tree Expand file tree Collapse file tree 4 files changed +7
-6
lines changed
Expand file tree Collapse file tree 4 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 55/// Protocol for adding functionality to the container
66public protocol Behavior {
77 /// This will be invoked on each behavior added to the `container` for each `entry` added to the container using
8- /// one of the `register()` or type forwading methods
8+ /// one of the `register()` or type forwarding methods
99 ///
1010 /// - Parameters:
1111 /// - container: container into which an `entry` has been registered
1212 /// - type: Type which will be resolved using the `entry`
1313 /// - entry: ServiceEntry registered to the `container`
1414 /// - name: name under which the service has been registered to the `container`
1515 ///
16- /// - Remark: `Type` and `Service` can be different types in the case of type forwarding
16+ /// - Remark: `Type` and `Service` can be different types in the case of type forwarding (commonly used as `.implements()`).
17+ /// `Type` will represent the forwarded type key, and `Service` will represent the destination.
1718 func container< Type, Service> (
1819 _ container: Container ,
1920 didRegisterType type: Type . Type ,
Original file line number Diff line number Diff line change 1818
1919import Foundation
2020
21- // MARK: - Registeration with Arguments
21+ // MARK: - Registration with Arguments
2222extension Container {
2323<% (1..arg_count).each do |i| %>
2424<% arg_types = (1..i).map { |n| "Arg#{n}" }.join(", ") %>
Original file line number Diff line number Diff line change 1212
1313import Foundation
1414
15- // MARK: - Registeration with Arguments
15+ // MARK: - Registration with Arguments
1616
1717extension Container {
1818 /// Adds a registration for the specified service with the factory closure to specify how the service is resolved with dependencies.
Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ internal protocol ServiceEntryProtocol: AnyObject {
1818/// As a returned instance from ``Container/register(_:name:factory:)-8gy9r``, some configurations can be added.
1919public final class ServiceEntry < Service> : ServiceEntryProtocol {
2020 fileprivate var initCompletedActions : [ ( Resolver , Service ) -> Void ] = [ ]
21- internal let serviceType : Any . Type
22- internal let argumentsType : Any . Type
21+ public let serviceType : Any . Type
22+ public let argumentsType : Any . Type
2323
2424 internal let factory : FunctionType
2525 internal weak var container : Container ?
You can’t perform that action at this time.
0 commit comments