diff --git a/Sources/LuminateCore/Injected.swift b/Sources/LuminateCore/Injected.swift new file mode 100644 index 0000000..9b53dfd --- /dev/null +++ b/Sources/LuminateCore/Injected.swift @@ -0,0 +1,17 @@ +import Foundation + +@propertyWrapper +public struct Injected { + + private let keyPath: KeyPath + + @MainActor + public var wrappedValue: T { + DIContainer.shared.resolve(keyPath) + } + + public init(_ keyPath: KeyPath) { + self.keyPath = keyPath + } + +}