File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
Sources/ComposableArchitecture/Documentation.docc/Articles Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff 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 )
Original file line number Diff line number Diff 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
410410private 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}
You can’t perform that action at this time.
0 commit comments