File tree Expand file tree Collapse file tree 2 files changed +16
-20
lines changed Expand file tree Collapse file tree 2 files changed +16
-20
lines changed Original file line number Diff line number Diff line change @@ -88,17 +88,15 @@ extension Shared {
88
88
/// - Parameter key: A shared key associated with the shared reference. It is responsible for
89
89
/// loading and saving the shared reference's value from some external source.
90
90
public func load( _ key: some SharedKey < Value > ) async throws {
91
- await MainActor . run {
92
- @Dependency ( PersistentReferences . self) var persistentReferences
93
- SharedPublisherLocals . $isLoading. withValue ( true ) {
94
- projectedValue = Shared (
95
- reference: persistentReferences. value (
96
- forKey: key,
97
- default: wrappedValue,
98
- skipInitialLoad: true
99
- )
91
+ @Dependency ( PersistentReferences . self) var persistentReferences
92
+ SharedPublisherLocals . $isLoading. withValue ( true ) {
93
+ projectedValue = Shared (
94
+ reference: persistentReferences. value (
95
+ forKey: key,
96
+ default: wrappedValue,
97
+ skipInitialLoad: true
100
98
)
101
- }
99
+ )
102
100
}
103
101
try await load ( )
104
102
}
Original file line number Diff line number Diff line change @@ -154,17 +154,15 @@ extension SharedReader {
154
154
/// - Parameter key: A shared key associated with the shared reference. It is responsible for
155
155
/// loading the shared reference's value from some external source.
156
156
public func load( _ key: some SharedReaderKey < Value > ) async throws {
157
- await MainActor . run {
158
- @Dependency ( PersistentReferences . self) var persistentReferences
159
- SharedPublisherLocals . $isLoading. withValue ( true ) {
160
- projectedValue = SharedReader (
161
- reference: persistentReferences. value (
162
- forKey: key,
163
- default: wrappedValue,
164
- skipInitialLoad: true
165
- )
157
+ @Dependency ( PersistentReferences . self) var persistentReferences
158
+ SharedPublisherLocals . $isLoading. withValue ( true ) {
159
+ projectedValue = SharedReader (
160
+ reference: persistentReferences. value (
161
+ forKey: key,
162
+ default: wrappedValue,
163
+ skipInitialLoad: true
166
164
)
167
- }
165
+ )
168
166
}
169
167
try await load ( )
170
168
}
You can’t perform that action at this time.
0 commit comments