Skip to content

Commit 525890a

Browse files
authored
Fix invalid states count for 3 optionals and typos (#2094)
1 parent 11f02b7 commit 525890a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Sources/ComposableArchitecture/Documentation.docc/Articles/StackBasedNavigation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ model your domains, how to integrate features, how to test your features, and mo
88
Stack-based navigation is the process of modeling navigation using collections of state. This style
99
of navigation allows you to deep-link into any state of your application by simply constructing a
1010
flat collection of data, handing, handing it off to SwiftUI, and letting it take care of the rest.
11-
It also allows for complex and recusive navigation paths in your application.
11+
It also allows for complex and recursive navigation paths in your application.
1212

1313
* [Basics](#Basics)
1414
* [Integration](#Integration)
@@ -240,7 +240,7 @@ case .closeButtonTapped:
240240
```
241241

242242
However, in order to do this you must have access to that stack state, and usually only the parent
243-
has access. But often we would like to encpasulate the logic of dismissing a feature to be inside
243+
has access. But often we would like to encapsulate the logic of dismissing a feature to be inside
244244
the child feature without needing explicit communication with the parent.
245245

246246
SwiftUI provides a wonderful tool for allowing child _views_ to dismiss themselves from the parent,
@@ -446,7 +446,7 @@ await store.receive(.path(.popFrom(id: 0))) {
446446
}
447447
```
448448

449-
This shows how we can write very naunced tests on how parent and child features interact with each
449+
This shows how we can write very nuanced tests on how parent and child features interact with each
450450
other in a navigation stack.
451451

452452
However, the more complex the features become, the more cumbersome testing their integration can be.
@@ -487,7 +487,7 @@ lines and is more resilient to future changes in the features that we don't nece
487487

488488
SwiftUI comes with a powerful type for modeling data in navigation stacks called
489489
[`NavigationPath`][nav-path-docs], and so you might wonder why we created our own data type,
490-
``StackState``, instead of leverating `NavigationPath`.
490+
``StackState``, instead of leveraging `NavigationPath`.
491491

492492
The `NavigationPath` data type is a type-erased list of data that is tuned specifically for
493493
`NavigationStack`s. It allows you to maximally decouple features in the stack since you can add any

Sources/ComposableArchitecture/Documentation.docc/Articles/TreeBasedNavigation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ must check multiple optionals to figure out which one is non-`nil`, and then we
156156
to interpret when multiple pieces of state are non-`nil` at the same time.
157157

158158
And the number of invalid states increases exponentially with respect to the number of features that
159-
can be navigated to. For example, 3 optionals leads to 3 invalid states, 4 optionals leads to 11
159+
can be navigated to. For example, 3 optionals leads to 4 invalid states, 4 optionals leads to 11
160160
invalid states, and 5 optionals leads to 26 invalid states.
161161

162162
For these reasons, and more, it can be better to model multiple destinations in a feature as a
@@ -340,7 +340,7 @@ case .closeButtonTapped:
340340
```
341341

342342
In order to `nil` out the presenting state you must have access to that state, and usually only the
343-
parent has access, but often we would like to encpasulate the logic of dismissing a feature to be
343+
parent has access, but often we would like to encapsulate the logic of dismissing a feature to be
344344
inside the child feature without needing explicit communication with the parent.
345345

346346
SwiftUI provides a wonderful tool for allowing child _views_ to dismiss themselves from the parent,
@@ -499,7 +499,7 @@ await store.receive(.counter(.dismiss)) {
499499
}
500500
```
501501

502-
This shows how we can write very naunced tests on how parent and child features interact with each
502+
This shows how we can write very nuanced tests on how parent and child features interact with each
503503
other.
504504

505505
However, the more complex the features become, the more cumbersome testing their integration can be.

0 commit comments

Comments
 (0)