Skip to content

Commit

Permalink
make subscript public
Browse files Browse the repository at this point in the history
  • Loading branch information
JARMourato committed Jun 26, 2024
1 parent f109b4c commit a4f4a7e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/Injection/Dependency.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ public struct DependencyValues {
private var values: [ObjectIdentifier: Any] = [:]

init() {}

@usableFromInline static var shared = DependencyValues()

subscript<K>(key: K.Type) -> K.Value where K: DependencyKey {
public subscript<K>(key: K.Type) -> K.Value where K: DependencyKey {
get { values[ObjectIdentifier(key)] as? K.Value ?? key.defaultValue }
set { values[ObjectIdentifier(key)] = newValue }
}
Expand Down

0 comments on commit a4f4a7e

Please sign in to comment.