diff --git a/Examples/CaseStudies/SwiftUICaseStudies/04-HigherOrderReducers-ResuableOfflineDownloads/DownloadComponent.swift b/Examples/CaseStudies/SwiftUICaseStudies/04-HigherOrderReducers-ResuableOfflineDownloads/DownloadComponent.swift index 503767e6a00c..3f3f87519e47 100644 --- a/Examples/CaseStudies/SwiftUICaseStudies/04-HigherOrderReducers-ResuableOfflineDownloads/DownloadComponent.swift +++ b/Examples/CaseStudies/SwiftUICaseStudies/04-HigherOrderReducers-ResuableOfflineDownloads/DownloadComponent.swift @@ -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) @@ -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), @@ -148,10 +148,6 @@ extension Reducer { } } -private struct ThrottleId: Hashable where ID: Hashable { - var id: ID -} - private let deleteAlert = DownloadAlert( primaryButton: .init( action: .alert(.deleteButtonTapped), diff --git a/Examples/README.md b/Examples/README.md index 80f705102b68..5555a6c4d792 100644 --- a/Examples/README.md +++ b/Examples/README.md @@ -5,6 +5,9 @@ This directory holds many case studies and applications to demonstrate solving v * **Case Studies**
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** +
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**
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. diff --git a/README.md b/README.md index ce9148897d86..d625e297f919 100644 --- a/README.md +++ b/README.md @@ -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)