Skip to content

Commit

Permalink
Fix backward compatibility issue with swift-concurrency-extras (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
tgrapperon authored Nov 9, 2023
1 parent 3223855 commit 02e7b18
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/UserDefaultsDependency/UserDefaultsDependency.swift
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,12 @@ extension UserDefaults.Dependency: TestDependencyKey {
return UserDefaults.Dependency { key, _ in
storage.value[key]
} set: { value, key in
var valueDidChange = false
let valueDidChange = LockIsolated(false)
storage.withValue {
valueDidChange = !_isEqual($0[key], value)
valueDidChange.setValue(!_isEqual($0[key], value))
$0[key] = value
}
if valueDidChange {
if valueDidChange.value {
for continuation in continuations.value[key]?.values ?? [:].values {
continuation.yield(value)
}
Expand Down

0 comments on commit 02e7b18

Please sign in to comment.