diff --git a/Sources/ComposableArchitecture/Effects/Cancellation.swift b/Sources/ComposableArchitecture/Effects/Cancellation.swift index fd91186a8728..d6d3f14255f3 100644 --- a/Sources/ComposableArchitecture/Effects/Cancellation.swift +++ b/Sources/ComposableArchitecture/Effects/Cancellation.swift @@ -14,9 +14,14 @@ extension Effect { /// /// case .reloadButtonTapped: /// // Start a new effect to load the user - /// return self.apiClient.loadUser() - /// .map(Action.userResponse) - /// .cancellable(id: CancelID.loadUser, cancelInFlight: true) + /// return .run { + /// await send( + /// .userResponse( + /// TaskResult { try await self.apiClient.loadUser() } + /// ) + /// ) + /// } + /// .cancellable(id: CancelID.loadUser, cancelInFlight: true) /// /// case .cancelButtonTapped: /// // Cancel any in-flight requests to load the user