Skip to content

Commit

Permalink
Update Cancellation.swift (#2426)
Browse files Browse the repository at this point in the history
  • Loading branch information
yimajo authored Sep 3, 2023
1 parent 037e0ec commit cc11adf
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Sources/ComposableArchitecture/Effects/Cancellation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cc11adf

Please sign in to comment.