We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Shared(require:)
1 parent ae10560 commit df65474Copy full SHA for df65474
Sources/Sharing/SharedKeys/DefaultKey.swift
@@ -46,7 +46,7 @@ public struct _SharedKeyDefault<Base: SharedReaderKey>: SharedReaderKey {
46
}
47
48
public func load(initialValue: Base.Value?) -> Base.Value? {
49
- base.load(initialValue: initialValue ?? defaultValue())
+ base.load(initialValue: initialValue)
50
51
52
public func subscribe(
Tests/SharingTests/DefaultTests.swift
@@ -84,6 +84,12 @@ import Testing
84
#expect(isOn == true)
85
86
87
+
88
+ @Test func requireShouldThrow() {
89
+ withKnownIssue {
90
+ _ = try Shared(require: .isOn)
91
+ }
92
93
94
95
extension SharedReaderKey where Self == InMemoryKey<Bool>.Default {
0 commit comments