Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ extension Reducer {
case .downloadClient(.success(.response)):
state.mode = .downloaded
state.alert = nil
return .cancel(id: ThrottleId(id: state.id))
return .none

case let .downloadClient(.success(.updateProgress(progress))):
state.mode = .downloading(progress: progress)
Expand All @@ -139,7 +139,7 @@ extension Reducer {
case .downloadClient(.failure):
state.mode = .notDownloaded
state.alert = nil
return .cancel(id: ThrottleId(id: state.id))
return .none
}
}
.pullback(state: state, action: action, environment: environment),
Expand All @@ -148,10 +148,6 @@ extension Reducer {
}
}

private struct ThrottleId<ID>: Hashable where ID: Hashable {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated, but removing some old code.

var id: ID
}

private let deleteAlert = DownloadAlert(
primaryButton: .init(
action: .alert(.deleteButtonTapped),
Expand Down
3 changes: 3 additions & 0 deletions Examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ This directory holds many case studies and applications to demonstrate solving v
* **Case Studies**
<br> Demonstrates how to solve some common application problems in an isolated environment, in both SwiftUI and UIKit. Things like bindings, navigation, effects, and reusable components.

* **Location Manager**
<br> This application uses Apple's CoreLocation and MapKit frameworks to allow the user to search for points of interest on a map. It also includes the ability to center the map on your current location, as well as a full test suite for how the app interacts with `CLLocationManager` and `MKLocalSearch`.

* **Motion Manager**
<br> This application uses Apple's CoreMotion framework to show a graph of device movements. It's a demonstration of how to wrap complex dependencies in the `Effect` type so that you can interact with them in the reducer _and_ write tests for its logic.

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ This repo comes with _lots_ of examples to demonstrate how to solve common and c
* Navigation
* Higher-order reducers
* Reusable components
* [Location manager](./Examples/LocationManager)
* [Motion manager](./Examples/MotionManager)
* [Search](./Examples/Search)
* [Speech Recognition](./Examples/SpeechRecognition)
Expand Down