Skip to content

Commit

Permalink
Use Task MainActor to queue up set call
Browse files Browse the repository at this point in the history
  • Loading branch information
0xLeif committed Oct 25, 2024
1 parent 13b3481 commit e2a33d8
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions Sources/AppState/Application/Types/State/Application+State.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,16 @@ extension Application {
)
else {
defer {
shared.cache.set(
value: Application.State(
type: .state,
initial: _value,
scope: scope
),
forKey: scope.key
)
Task { @MainActor in
shared.cache.set(
value: Application.State(
type: .state,
initial: _value,
scope: scope
),
forKey: scope.key
)
}
}
return _value
}
Expand Down

0 comments on commit e2a33d8

Please sign in to comment.