|
116 | 116 | To do this we can chain into the `addContact` case name directly and mutate a part of its
|
117 | 117 | associated value.
|
118 | 118 |
|
119 |
| - > Tip: To chain into an enum and mutate an associated value, the enum must be annotated with |
120 |
| - > `@CasePathable` _and_ `@dynamicMemberLookup`. The `@Reducer` macro automatically applies |
121 |
| - > these annotations to enum-based `State`, but you must manually apply it to other enums. |
| 119 | + > Tip: To use the `modify` helper on an enum to mutate an associated value, the enum must |
| 120 | + > be annotated with `@CasePathable`. The `@Reducer` macro automatically applies |
| 121 | + > this annotation to enum-based `State`, but you must manually apply it to other enums. |
122 | 122 |
|
123 | 123 | @Code(name: "ContactsFeatureTests.swift", file: 02-03-01-code-0011.swift)
|
124 | 124 | }
|
|
146 | 146 | }
|
147 | 147 |
|
148 | 148 | @Step {
|
149 |
| - To further assert that when the `saveContact` delegate action was received, you must |
| 149 | + To further assert that the `saveContact` delegate action was received, you must |
150 | 150 | annotate `AddContactFeature.Action.Delegate` with the `@CasePathable` macro.
|
151 | 151 |
|
152 | 152 | @Code(name: "ContactsFeature.swift", file: 02-03-01-code-0015.swift, previousFile: 02-03-01-code-0015-previous.swift)
|
|
308 | 308 | @Step {
|
309 | 309 | Make use of the new `deleteConfirmation` static alert function in the `ContactsFeature`
|
310 | 310 | reducer, rather than building `AlertState` from scratch.
|
| 311 | + |
| 312 | + Also to further assert that the `confirmDeletion` action was received, |
| 313 | + annotate `ContactsFeature.Action.Alert` with the `@CasePathable` macro. |
311 | 314 |
|
312 | 315 | @Code(name: "ContactsFeature.swift", file: 02-03-03-code-0007.swift, previousFile: 02-03-03-code-0007-previous.swift)
|
313 | 316 | }
|
|
0 commit comments