Files
Stephen Celis 85417e000e Update documentation and examples to use Swift Testing (#3413)
* Testing: Case Studies

* Testing: Search

* Testing: Speech Recognition

* Testing: SyncUps

* Project Settings

* Testing: TicTacToe

* Testing: Todos

* Testing: Voice Memos

* Update tutorials/docs

* fix

* Fixes

* wip

* Update ci.yml

* Update ci.yml

* Update ci.yml

* wip

* wip

* Quiet

* fix

* wip

* wip

* flaky

* wip

* wip

* fix
2024-10-02 16:28:33 -07:00
..
2022-10-23 22:28:31 -07:00

Search

This application demonstrates how to build a moderately complex search feature in the Composable Architecture:

  • Typing into the search field executes an API request to search for locations.
  • Tapping a location runs another API request to fetch the weather for that location, and when a response is received the data is displayed inline in that row.

In addition to those basic features, the following extra things are implemented:

  • Search API requests are debounced so that one is run only after the user stops typing for 300ms.
  • If you tap a location while a weather API request is already in-flight it will cancel that request and start a new one.
  • Dependencies and side effects are fully controlled. The reducer that runs this application needs a weather API client to run effects.
  • A full test suite is implemented. Not only is core functionality tested, but also failure flows and subtle edge cases (e.g. clearing the search query cancels any in-flight search requests).