Skip to content

Commit

Permalink
Fix unneeded retention in property wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
hmlongco committed Jun 27, 2022
1 parent afed637 commit 2f6511a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Factory Changelog

### 1.0.5

* Fix unneeded Factory retention in Injected Property Wrapper
* Some internal name changes
* Added Multipl Module examples in demo project

### 1.0.4

* Optimize creation of factory cache id
Expand Down
2 changes: 0 additions & 2 deletions Sources/Factory/Factory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,9 @@ private struct WeakBox: AnyBox {

/// Convenience property wrappeer takes a factory and creates an instance of the desired type.
@propertyWrapper public struct Injected<T> {
private var factory: Factory<T>
private var dependency: T
public init(_ factory: Factory<T>) {
self.dependency = factory()
self.factory = factory
}
public var wrappedValue: T {
get { return dependency }
Expand Down

0 comments on commit 2f6511a

Please sign in to comment.