Skip to content

Commit b2f3ba5

Browse files
authored
Add EffectOf (#2237)
Joins `ReducerOf` and `StoreOf` for simplifying some call sites.
1 parent b6efb27 commit b2f3ba5

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

Sources/ComposableArchitecture/Documentation.docc/Extensions/Effect.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- ``EffectPublisher/none``
88
- ``EffectPublisher/run(priority:operation:catch:fileID:line:)``
99
- ``EffectPublisher/send(_:)``
10+
- ``EffectOf``
1011
- ``TaskResult``
1112

1213
### Cancellation

Sources/ComposableArchitecture/Effect.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,21 @@ public struct EffectPublisher<Action, Failure: Error> {
6969
}
7070
}
7171

72+
/// A convenience type alias for referring to an effect of a given reducer's domain.
73+
///
74+
/// Instead of specifying the action:
75+
///
76+
/// ```swift
77+
/// let effect: EffectTask<Feature.Action>
78+
/// ```
79+
///
80+
/// You can specify the reducer:
81+
///
82+
/// ```swift
83+
/// let effect: EffectOf<Feature>
84+
/// ```
85+
public typealias EffectOf<R: ReducerProtocol> = EffectPublisher<R.Action, Never>
86+
7287
// MARK: - Creating Effects
7388

7489
extension EffectPublisher {

0 commit comments

Comments
 (0)