Skip to content

Commit ccc898f

Browse files
committed
Update factory from factorykit
1 parent 321ddb3 commit ccc898f

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

Factory.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "Factory"
3-
s.version = "2.5.2"
3+
s.version = "2.5.3"
44
s.summary = "A Modern Dependency Injection / Service Locator framework for Swift on iOS."
55
s.homepage = "https://github.com/hmlongco/Factory"
66
s.license = "MIT"

Sources/Factory/Factory/Containers.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ public final class ContainerManager: @unchecked Sendable {
249249
/// Public initializer
250250
public init() {}
251251

252-
/// Default scope
252+
/// Default scope. Setting scope to nil returns the default to `unique`.
253253
public var defaultScope: Scope? {
254254
get { globalVariableLock.withLock { _defaultScope } }
255255
set { globalVariableLock.withLock { _defaultScope = newValue } }
@@ -338,6 +338,9 @@ extension ContainerManager {
338338
self.options.removeAll(keepingCapacity: true)
339339
self.cache.reset()
340340
self.autoRegistrationCheckNeeded = true
341+
self._defaultScope = nil
342+
self._dependencyChainTestMax = 8
343+
self._promiseTriggersError = FactoryContext.current.isDebug && !FactoryContext.current.isPreview
341344
case .context:
342345
for (key, option) in self.options {
343346
var mutable = option

Sources/Factory/Factory/Modifiers.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ extension FactoryModifying {
5757
/// ```
5858
/// Primarily used to assign custom scopes.
5959
@discardableResult
60-
public func scope(_ scope: Scope?) -> Self {
60+
public func scope(_ scope: Scope) -> Self {
6161
registration.scope(scope)
6262
return self
6363
}

Sources/Factory/Factory/Scopes.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ extension Scope {
193193

194194
/// A reference to the default unique scope.
195195
///
196-
/// If no scope cache is specified then Factory is running in unique mode.
196+
/// If no scope cache is specified then Factory is running in unique mode.
197197
public static let unique = Unique()
198198

199199
/// Defines the unique scope. A new instance of a given type will be returned on every resolution cycle.

0 commit comments

Comments
 (0)