Skip to content
18 changes: 12 additions & 6 deletions Examples/Search/Search/SearchApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@ import SwiftUI

@main
struct SearchApp: App {

@MainActor
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe this is needed since the App protocol is @MainActor.

Suggested change
@MainActor

static let store = Store(initialState: Search.State()) {
Search()
._printChanges()
}

var body: some Scene {
WindowGroup {
SearchView(
store: Store(initialState: Search.State()) {
Search()
._printChanges()
}
)
if isTesting {
EmptyView()
} else {
SearchView(store: Self.store)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're not doing UI tests I think we can simplify:

Suggested change
if isTesting {
EmptyView()
} else {
SearchView(store: Self.store)
}
SearchView(store: Self.store)

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@ import SwiftUI

@main
struct SpeechRecognitionApp: App {

@MainActor
static let store = Store(initialState: SpeechRecognition.State()) {
SpeechRecognition()
._printChanges()
}

var body: some Scene {
WindowGroup {
SpeechRecognitionView(
store: Store(initialState: SpeechRecognition.State()) {
SpeechRecognition()._printChanges()
}
)
if isTesting {
EmptyView()
} else {
SpeechRecognitionView(store: Self.store)
}
}
}
}
19 changes: 14 additions & 5 deletions Examples/Todos/Todos/TodosApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,22 @@ import SwiftUI

@main
struct TodosApp: App {

@MainActor
static let store = Store(initialState: Todos.State()) {
Todos()
._printChange()
}

var body: some Scene {
WindowGroup {
AppView(
store: Store(initialState: Todos.State()) {
Todos()
}
)
if isTesting {
EmptyView()
} else {
AppView(store: Self.store)
}
}
}
}


17 changes: 12 additions & 5 deletions Examples/VoiceMemos/VoiceMemos/VoiceMemosApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@ import SwiftUI

@main
struct VoiceMemosApp: App {

@MainActor
static let store = Store(initialState: VoiceMemos.State()) {
VoiceMemos()
._printChanges()
}

var body: some Scene {
WindowGroup {
VoiceMemosView(
store: Store(initialState: VoiceMemos.State()) {
VoiceMemos()._printChanges()
}
)
if isTesting {
EmptyView()
} else {
VoiceMemosView(store: Self.store)
}
}
}
}