|
44 | 44 | /// ```
|
45 | 45 | ///
|
46 | 46 | /// The `reduce` method's first responsibility is to mutate the feature's current state given an
|
47 |
| - /// action. It's second responsibility is to return effects that will be executed asynchronously |
| 47 | + /// action. Its second responsibility is to return effects that will be executed asynchronously |
48 | 48 | /// and feed their data back into the system. Currently `Feature` does not need to run any effects,
|
49 | 49 | /// and so ``EffectPublisher/none`` is returned.
|
50 | 50 | ///
|
51 | 51 | /// If the feature does need to do effectful work, then more would need to be done. For example,
|
52 | 52 | /// suppose the feature has the ability to start and stop a timer, and with each tick of the timer
|
53 |
| - /// the `count` was incremented. That could be done like so: |
| 53 | + /// the `count` will be incremented. That could be done like so: |
54 | 54 | ///
|
55 | 55 | /// ```swift
|
56 | 56 | /// struct Feature: ReducerProtocol {
|
|
76 | 76 | /// state.count += 1
|
77 | 77 | /// return .none
|
78 | 78 | ///
|
79 |
| - /// case startTimerButtonTapped: |
| 79 | + /// case .startTimerButtonTapped: |
80 | 80 | /// return .run { send in
|
81 | 81 | /// while true {
|
82 | 82 | /// try await Task.sleep(for: .seconds(1))
|
|
85 | 85 | /// }
|
86 | 86 | /// .cancellable(TimerID.self)
|
87 | 87 | ///
|
88 |
| - /// case stopTimerButtonTapped: |
| 88 | + /// case .stopTimerButtonTapped: |
89 | 89 | /// return .cancel(TimerID.self)
|
90 | 90 | ///
|
91 |
| - /// case timerTick: |
| 91 | + /// case .timerTick: |
92 | 92 | /// state.count += 1
|
93 | 93 | /// return .none
|
94 | 94 | /// }
|
|
115 | 115 | ///
|
116 | 116 | /// At most one of these requirements should be implemented. If a conformance implements both
|
117 | 117 | /// requirements, only ``reduce(into:action:)-8yinq`` will be called by the ``Store``. If your
|
118 |
| - /// reducer assembles a body from other reducers _and_ has additional business logic it needs to |
| 118 | + /// reducer assembles a body from other reducers _and_ has additional business logic, it needs to |
119 | 119 | /// layer onto the feature, introduce this logic into the body instead, either with ``Reduce``:
|
120 | 120 | ///
|
121 | 121 | /// ```swift
|
|
205 | 205 | /// > Important: if your reducer implements the ``reduce(into:action:)-8yinq`` method, it will
|
206 | 206 | /// > take precedence over this property, and only ``reduce(into:action:)-8yinq`` will be called
|
207 | 207 | /// > by the ``Store``. If your reducer assembles a body from other reducers and has additional
|
208 |
| - /// > business logic it needs to layer into the system, introduce this logic into the body |
| 208 | + /// > business logic, it needs to layer into the system, introduce this logic into the body |
209 | 209 | /// > instead, either with ``Reduce``, or with a separate, dedicated conformance.
|
210 | 210 | @ReducerBuilder<State, Action>
|
211 | 211 | var body: Body { get }
|
|
227 | 227 | ///
|
228 | 228 | /// At most one of these requirements should be implemented. If a conformance implements both
|
229 | 229 | /// requirements, only ``reduce(into:action:)-8yinq`` will be called by the ``Store``. If your
|
230 |
| - /// reducer assembles a body from other reducers _and_ has additional business logic it needs to |
| 230 | + /// reducer assembles a body from other reducers _and_ has additional business logic, it needs to |
231 | 231 | /// layer onto the feature, introduce this logic into the body instead, either with ``Reduce``:
|
232 | 232 | ///
|
233 | 233 | /// ```swift
|
|
315 | 315 | /// > Important: if your reducer implements the ``reduce(into:action:)-8yinq`` method, it will
|
316 | 316 | /// > take precedence over this property, and only ``reduce(into:action:)-8yinq`` will be called
|
317 | 317 | /// > by the ``Store``. If your reducer assembles a body from other reducers and has additional
|
318 |
| - /// > business logic it needs to layer into the system, introduce this logic into the body |
| 318 | + /// > business logic, it needs to layer into the system, introduce this logic into the body |
319 | 319 | /// > instead, either with ``Reduce``, or with a separate, dedicated conformance.
|
320 | 320 | @ReducerBuilder<State, Action>
|
321 | 321 | var body: Body { get }
|
|
0 commit comments