Skip to content

Commit 3f30621

Browse files
authored
Fix typo in GettingStarted.md and README.md (#1659)
* fix typo GettingStarted.md * fix typo README
1 parent aefb996 commit 3f30621

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
@@ -353,7 +353,7 @@ struct MyApp: App {
353353
numberFact: { number in
354354
let (data, _) = try await URLSession.shared
355355
.data(from: .init(string: "http://numbersapi.com/\(number)")!)
356-
return String(decoding: data, using: UTF8.self)
356+
return String(decoding: data, as: UTF8.self)
357357
}
358358
)
359359
)

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)