Skip to content

Commit

Permalink
Fix cancellation of refreshing AsyncPhaseAtom
Browse files Browse the repository at this point in the history
  • Loading branch information
ra1028 committed Oct 10, 2024
1 parent 90cd87a commit 416a704
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Sources/Atoms/Atom/AsyncPhaseAtom.swift
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ public extension AsyncPhaseAtom {
#endif
}

context.onTermination = task.cancel

return await withTaskCancellationHandler {
await task.value
return phase
Expand Down

0 comments on commit 416a704

Please sign in to comment.