Skip to content

Commit

Permalink
Make Dependency.override public (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximBazarov authored Oct 18, 2022
1 parent e50b58c commit ec75006
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 5 additions & 2 deletions Sources/Dependency.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,11 @@ public final class Dependency<Value> {
self.lifespan = lifespan
self.scope = scope
}

func override(with value: Value) {


/// Overrides the injected value.
/// New value will be the one that is returned for ``instance``
public func override(with value: Value) {
localValue = value
}

Expand Down
1 change: 0 additions & 1 deletion Sources/Injected-PropertyWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,3 @@ class Injected<Value> {
self.dependency = Dependency(keyPath, lifespan: lifespan, scope: scope)
}
}

0 comments on commit ec75006

Please sign in to comment.