Skip to content

Commit 6c40d03

Browse files
mbrandonwmluisbrown
authored andcommitted
Require sendable cancel ID. (#1275)
(cherry picked from commit 558a0379be3b7fe1f3e3b16a050ae528d793c37a)
1 parent 33e0ff8 commit 6c40d03

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/ComposableArchitecture/Effects/Cancellation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ extension Task where Success == Never, Failure == Never {
225225
/// Cancel any currently in-flight operation with the given identifier.
226226
///
227227
/// - Parameter id: An identifier.
228-
public static func cancel(id: AnyHashable) async {
228+
public static func cancel<ID: Hashable & Sendable>(id: ID) async {
229229
await MainActor.run {
230230
cancellablesLock.sync { cancellationCancellables[.init(id: id)]?.forEach { $0.dispose() } }
231231
}

0 commit comments

Comments
 (0)