Skip to content

Commit a658e25

Browse files
Added reminder to use the .fetch() in the reduce() when using NumberFactClient
1 parent 2c0caf6 commit a658e25

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,14 @@ struct MyApp: App {
524524
}
525525
```
526526

527+
Then we can use it in the `reduce` implementation with the additional of `fetch`:
528+
529+
```swift
530+
case .numberFactButtonTapped:
531+
return .task { [count = state.count] in
532+
await .numberFactResponse(TaskResult { try await self.numberFact.fetch(count) })
533+
}
534+
527535
And the test store can be constructed without specifying any dependencies, but you can still
528536
override any dependency you need to for the purpose of the test:
529537

0 commit comments

Comments
 (0)