Skip to content

Commit

Permalink
[FIX] Added WindowGroup to App/body (#2484)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaesung authored Sep 26, 2023
1 parent 6a242ad commit bec8baa
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,18 +403,20 @@ interacts with the real world API server:
@main
struct MyApp: App {
var body: some Scene {
FeatureView(
store: Store(initialState: Feature.State()) {
Feature(
numberFact: { number in
let (data, _) = try await URLSession.shared.data(
from: URL(string: "http://numbersapi.com/\(number)")!
)
return String(decoding: data, as: UTF8.self)
}
)
}
)
WindowGroup {
FeatureView(
store: Store(initialState: Feature.State()) {
Feature(
numberFact: { number in
let (data, _) = try await URLSession.shared.data(
from: URL(string: "http://numbersapi.com/\(number)")!
)
return String(decoding: data, as: UTF8.self)
}
)
}
)
}
}
}
```
Expand Down

0 comments on commit bec8baa

Please sign in to comment.