Fix regression: SyncUpDetailNavigation tutorial step 03-code-0004 drops the Array(...) wrapper from step 03-code-0003 - #3962
Open
carlosypunto wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's wrong
In the "Meet the Composable Architecture" → "Building SyncUps" → SyncUpDetailNavigation tutorial (section 3,
SyncUpsList.swift), step03-code-0003correctly introduces:with an explicit callout explaining why the
Arrayinitializer is needed to pass the shared collection along toForEach.The very next step,
03-code-0004, is documented as only replacing the<#Shared<SyncUp>#>placeholder with$syncUpinsideSyncUpDetail.State(syncUp: ...). However, the code file for that step also silently reverts theForEachline back to:i.e. it drops the
Array(...)wrapper that was just introduced and explained one step earlier — with no mention of this change in the step's instructions.Why this is a regression, not intentional
$syncUptoSyncUpDetail.State") say nothing about touching theForEachcall.Examples/SyncUps/SyncUps/SyncUpsList.swiftusesForEach(Array(store.$syncUps)), confirming this is the intended final form.Fix
Restore
Array(...)inSyncUpDetailNavigation-03-code-0004.swiftso it matches step 03-code-0003 plus the placeholder replacement, consistent with the reference app.Screenshots
1. Step 03-code-0002 — baseline, before the

Arrayfix2. Step 03-code-0003 — the fix:

Array(...)is introduced3. Step 03-code-0004 — the regression:

Array(...)is dropped again