swift-composable-architecture
swift-composable-architecture copied to clipboard
[Building Sync-ups Tutorial] fixes in "Persisting sync-ups" chapter
Hi!
Following my last PR, I'm currently reviewing the "Building Sync-ups" tutorial and so far, there is a lot of changes so I've splitted up into one PR per chapter to ease the review of them, continuing with the "Persisting sync-ups" chapter here…
Changes Made:
-
"Persisting data to disk" Tutorial Section Enhancements:
- Implemented thread-safe mutations of the shared
syncUps
usingwithLock
. - Updated the tutorial code to compile correctly with the new file storage approach.
- Implemented thread-safe mutations of the shared
-
"Testing persistence" Tutorial Section Improvements:
- Moved the initialization of
syncUps
outside of theTestStore
to prevent shared state issues during testing. - Incorporated
withLock
for thread-safe mutations of shared state. - Enhanced the tutorial explanation to provide clearer guidance on the fixes implemented.
- Moved the initialization of
Doing so, I needed to add new steps in the tutorial description and so new code files too. I tried my best to match your tone and vocabulary in the description of the new steps but feel free to enhance the copyrighting if you need to.