Skip to content

Commit 9a06e90

Browse files
tgrapperonp4checo
authored andcommitted
Add a EffectTask<Action> typealias for Effect<Action, Never> and rename Effect to EffectPublisher (#1471)
* Add an `EffectOf<Action>` typealias for `Effect<Action, Never>` * Fix doc * Rename `EffectOf` to `EffectTask` * Rename `Effect` to `EffectPublisher` * Soft-deprecate `Effect` * Link to `EffectTask` * Use `EffectPublisher` in Combine contexts * Reword soft-deprecation message * Remove `renamed:` fix-it for `Effect` deprecation * Update Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerProtocol.md Co-authored-by: Stephen Celis <[email protected]> * Update Sources/ComposableArchitecture/Documentation.docc/ComposableArchitecture.md * Update Sources/ComposableArchitecture/Effect.swift * Fix DocC identifiers Co-authored-by: Stephen Celis <[email protected]> (cherry picked from commit 41f1cb9f3f7ed046deaed1b838cbaf6899ee9983) # Conflicts: # Sources/ComposableArchitecture/Documentation.docc/Articles/GettingStarted.md # Sources/ComposableArchitecture/Effect.swift # Sources/ComposableArchitecture/Effects/Animation.swift # Sources/ComposableArchitecture/Effects/ConcurrencySupport.swift # Sources/ComposableArchitecture/Effects/Publisher/Timer.swift # Sources/ComposableArchitecture/Effects/SignalProducer.swift # Sources/ComposableArchitecture/Internal/Create.swift # Sources/ComposableArchitecture/Internal/Deprecations.swift # Sources/ComposableArchitecture/Reducer/AnyReducer/AnyReducerSignpost.swift # Sources/ComposableArchitecture/Reducer/Reducers/SignpostReducer.swift # Sources/ComposableArchitecture/SwiftUI/Alert.swift # Sources/ComposableArchitecture/SwiftUI/ConfirmationDialog.swift # Sources/ComposableArchitecture/TestStore.swift # Sources/Dependencies/Dependencies/MainQueue.swift # Sources/Dependencies/Dependencies/MainRunLoop.swift # Tests/ComposableArchitectureTests/CompatibilityTests.swift # Tests/ComposableArchitectureTests/ComposableArchitectureTests.swift # Tests/ComposableArchitectureTests/EffectCancellationTests.swift # Tests/ComposableArchitectureTests/EffectRunTests.swift # Tests/ComposableArchitectureTests/EffectTaskTests.swift # Tests/ComposableArchitectureTests/EffectTests.swift # Tests/ComposableArchitectureTests/ReducerTests.swift # Tests/ComposableArchitectureTests/StoreTests.swift # Tests/ComposableArchitectureTests/TestStoreTests.swift # Tests/ComposableArchitectureTests/TimerTests.swift # Tests/ComposableArchitectureTests/ViewStoreTests.swift
1 parent aede577 commit 9a06e90

File tree

99 files changed

+3378
-3277
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+3378
-3277
lines changed

ComposableArchitecture.xcworkspace/xcshareddata/xcschemes/ComposableArchitecture.xcscheme

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
</BuildActionEntries>
2424
</BuildAction>
2525
<TestAction
26-
buildConfiguration = "Debug"
27-
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28-
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
26+
buildConfiguration = "Release"
27+
selectedDebuggerIdentifier = ""
28+
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
2929
shouldUseLaunchSchemeArgsEnv = "YES"
3030
codeCoverageEnabled = "YES">
3131
<Testables>

Examples/CaseStudies/SwiftUICaseStudies/01-GettingStarted-AlertsAndConfirmationDialogs.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct AlertAndConfirmationDialog: ReducerProtocol {
3737
case incrementButtonTapped
3838
}
3939

40-
func reduce(into state: inout State, action: Action) -> Effect<Action, Never> {
40+
func reduce(into state: inout State, action: Action) -> EffectTask<Action> {
4141
switch action {
4242
case .alertButtonTapped:
4343
state.alert = AlertState(

Examples/CaseStudies/SwiftUICaseStudies/01-GettingStarted-Animations.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ struct Animations: ReducerProtocol {
4141

4242
@Dependency(\.mainQueue) var mainQueue
4343

44-
func reduce(into state: inout State, action: Action) -> Effect<Action, Never> {
44+
func reduce(into state: inout State, action: Action) -> EffectTask<Action> {
4545
enum CancelID {}
4646

4747
switch action {

Examples/CaseStudies/SwiftUICaseStudies/01-GettingStarted-Bindings-Basics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct BindingBasics: ReducerProtocol {
3535
case toggleChanged(isOn: Bool)
3636
}
3737

38-
func reduce(into state: inout State, action: Action) -> Effect<Action, Never> {
38+
func reduce(into state: inout State, action: Action) -> EffectTask<Action> {
3939
switch action {
4040
case let .sliderValueChanged(value):
4141
state.sliderValue = value

Examples/CaseStudies/SwiftUICaseStudies/01-GettingStarted-Counter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct Counter: ReducerProtocol {
2121
case incrementButtonTapped
2222
}
2323

24-
func reduce(into state: inout State, action: Action) -> Effect<Action, Never> {
24+
func reduce(into state: inout State, action: Action) -> EffectTask<Action> {
2525
switch action {
2626
case .decrementButtonTapped:
2727
state.count -= 1

Examples/CaseStudies/SwiftUICaseStudies/01-GettingStarted-SharedState.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ struct SharedState: ReducerProtocol {
8888
case isPrimeButtonTapped
8989
}
9090

91-
func reduce(into state: inout State, action: Action) -> Effect<Action, Never> {
91+
func reduce(into state: inout State, action: Action) -> EffectTask<Action> {
9292
switch action {
9393
case .alertDismissed:
9494
state.alert = nil
@@ -140,7 +140,7 @@ struct SharedState: ReducerProtocol {
140140
case resetCounterButtonTapped
141141
}
142142

143-
func reduce(into state: inout State, action: Action) -> Effect<Action, Never> {
143+
func reduce(into state: inout State, action: Action) -> EffectTask<Action> {
144144
switch action {
145145
case .resetCounterButtonTapped:
146146
state.resetCount()

Examples/CaseStudies/SwiftUICaseStudies/02-Effects-Basics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ struct EffectsBasics: ReducerProtocol {
4040
@Dependency(\.mainQueue) var mainQueue
4141
private enum DelayID {}
4242

43-
func reduce(into state: inout State, action: Action) -> Effect<Action, Never> {
43+
func reduce(into state: inout State, action: Action) -> EffectTask<Action> {
4444
switch action {
4545
case .decrementButtonTapped:
4646
state.count -= 1

Examples/CaseStudies/SwiftUICaseStudies/02-Effects-Cancellation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct EffectsCancellation: ReducerProtocol {
3232
@Dependency(\.factClient) var factClient
3333
private enum NumberFactRequestID {}
3434

35-
func reduce(into state: inout State, action: Action) -> Effect<Action, Never> {
35+
func reduce(into state: inout State, action: Action) -> EffectTask<Action> {
3636
switch action {
3737
case .cancelButtonTapped:
3838
state.isFactRequestInFlight = false

Examples/CaseStudies/SwiftUICaseStudies/02-Effects-LongLiving.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct LongLivingEffects: ReducerProtocol {
2929

3030
@Dependency(\.screenshots) var screenshots
3131

32-
func reduce(into state: inout State, action: Action) -> Effect<Action, Never> {
32+
func reduce(into state: inout State, action: Action) -> EffectTask<Action> {
3333
switch action {
3434
case .task:
3535
// When the view appears, start the effect that emits when screenshots are taken.

Examples/CaseStudies/SwiftUICaseStudies/02-Effects-Refreshable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct Refreshable: ReducerProtocol {
3232
@Dependency(\.mainQueue) var mainQueue
3333
private enum FactRequestID {}
3434

35-
func reduce(into state: inout State, action: Action) -> Effect<Action, Never> {
35+
func reduce(into state: inout State, action: Action) -> EffectTask<Action> {
3636
switch action {
3737
case .cancelButtonTapped:
3838
return .cancel(id: FactRequestID.self)

0 commit comments

Comments
 (0)