Skip to content

Commit 3cd34b1

Browse files
committed
Use proper let for env keys
Was `var` for some for no reason.
1 parent 5aec0e7 commit 3cd34b1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Sources/DirectToSwiftUI/Environment/EnvironmentKeys.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ public extension D2SKeys {
2727

2828
struct debug: DynamicEnvironmentKey {
2929
#if DEBUG
30-
public static var defaultValue = true
30+
public static let defaultValue = true
3131
#else
32-
public static var defaultValue = false
32+
public static let defaultValue = false
3333
#endif
3434
}
3535

3636
struct database: DynamicEnvironmentKey {
37-
public static var defaultValue : Database = D2SDummyDatabase()
37+
public static let defaultValue : Database = D2SDummyDatabase()
3838
}
3939

4040
struct firstTask: DynamicEnvironmentKey {
@@ -51,7 +51,7 @@ public extension D2SKeys {
5151
struct object: DynamicEnvironmentKey {
5252
// TBD: This one should really be an EnvironmentObject, but how
5353
// would we do this? More in the keypath \.object.
54-
public static var defaultValue : OActiveRecord = .init()
54+
public static let defaultValue : OActiveRecord = .init()
5555
}
5656

5757
struct propertyKey: DynamicEnvironmentKey {
@@ -65,11 +65,11 @@ public extension D2SKeys {
6565
// MARK: - Model
6666

6767
struct model: DynamicEnvironmentKey {
68-
public static var defaultValue : Model = D2SDefaultModel()
68+
public static let defaultValue : Model = D2SDefaultModel()
6969
}
7070

7171
struct entity: DynamicEnvironmentKey {
72-
public static var defaultValue : Entity = D2SDefaultEntity.shared
72+
public static let defaultValue : Entity = D2SDefaultEntity.shared
7373
}
7474

7575
/**
@@ -80,7 +80,7 @@ public extension D2SKeys {
8080
* If that also fails, the default dummy attribute is returned.
8181
*/
8282
struct attribute: DynamicEnvironmentKey {
83-
public static var defaultValue : Attribute = D2SDefaultAttribute()
83+
public static let defaultValue : Attribute = D2SDefaultAttribute()
8484
}
8585

8686
/**
@@ -91,7 +91,7 @@ public extension D2SKeys {
9191
* If that also fails, the default dummy relationship is returned.
9292
*/
9393
struct relationship: DynamicEnvironmentKey {
94-
public static var defaultValue : Relationship = D2SDefaultRelationship()
94+
public static let defaultValue : Relationship = D2SDefaultRelationship()
9595
}
9696

9797
// MARK: - Derived

0 commit comments

Comments
 (0)