Skip to content

Commit 558a037

Browse files
authored
Require sendable cancel ID. (#1275)
1 parent d41f36c commit 558a037

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
@@ -205,7 +205,7 @@ extension Task where Success == Never, Failure == Never {
205205
/// Cancel any currently in-flight operation with the given identifier.
206206
///
207207
/// - Parameter id: An identifier.
208-
public static func cancel(id: AnyHashable) async {
208+
public static func cancel<ID: Hashable & Sendable>(id: ID) async {
209209
await MainActor.run {
210210
cancellablesLock.sync { cancellationCancellables[.init(id: id)]?.forEach { $0.cancel() } }
211211
}

0 commit comments

Comments
 (0)