// // DependencyStore.swift // DependencyInjection // // Created by Javier Cicchelli on 05/12/2022. // Copyright © 2022 Röck+Cöde. All rights reserved. // public struct DependencyStore { // MARK: Properties private static var current = Self() // MARK: Functions public static subscript(key: K.Type) -> K.Value where K: DependencyKey { get { key.currentValue } set { key.currentValue = newValue } } public static subscript(_ keyPath: WritableKeyPath) -> D { get { current[keyPath: keyPath] } set { current[keyPath: keyPath] = newValue } } }