Skip to content

Commit b887c75

Browse files
hmhvp4checo
authored andcommitted
Fix typo in GettingStarted.md and README.md (#1659)
* fix typo GettingStarted.md * fix typo README (cherry picked from commit 3f30621ae85abc72fae91d5bce126edae76b6b31)
1 parent c29b25d commit b887c75

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ struct MyApp: App {
367367
numberFact: { number in
368368
let (data, _) = try await URLSession.shared
369369
.data(from: .init(string: "http://numbersapi.com/\(number)")!)
370-
return String(decoding: data, using: UTF8.self)
370+
return String(decoding: data, as: UTF8.self)
371371
}
372372
)
373373
)

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ struct Feature: ReducerProtocol {
124124
TaskResult {
125125
String(
126126
decoding: try await URLSession.shared
127-
.data(from: URL(string: "http://numbersapi.com/\(number)/trivia")!).0,
128-
using: UTF8.self
127+
.data(from: URL(string: "http://numbersapi.com/\(count)/trivia")!).0,
128+
as: UTF8.self
129129
)
130130
}
131131
)
@@ -346,10 +346,10 @@ struct MyApp: App {
346346
store: Store(
347347
initialState: Feature.State(),
348348
reducer: Feature(
349-
numberFact: {
349+
numberFact: { number in
350350
let (data, _) = try await URLSession.shared
351351
.data(from: .init(string: "http://numbersapi.com/\(number)")!)
352-
return String(decoding: data, using: UTF8.self)
352+
return String(decoding: data, as: UTF8.self)
353353
}
354354
)
355355
)
@@ -409,10 +409,10 @@ dependency to be used by default:
409409
```swift
410410
private enum NumberFactClientKey: DependencyKey {
411411
static let liveValue = NumberFactClient(
412-
fetch: {
412+
fetch: { number in
413413
let (data, _) = try await URLSession.shared
414414
.data(from: .init(string: "http://numbersapi.com/\(number)")!)
415-
return String(decoding: data, using: UTF8.self)
415+
return String(decoding: data, as: UTF8.self)
416416
}
417417
)
418418
}

0 commit comments

Comments
 (0)