Skip to content

Commit 4223ffb

Browse files
stephencelisactions-user
authored andcommitted
Run swift-format
1 parent 4e7930f commit 4223ffb

File tree

2 files changed

+44
-43
lines changed

2 files changed

+44
-43
lines changed

Examples/CaseStudies/SwiftUICaseStudies/00-RootView.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,15 @@ struct RootView: View {
122122
)
123123

124124
#if compiler(>=5.5)
125-
NavigationLink(
126-
"Refreshable",
127-
destination: RefreshableView(
128-
store: self.store.scope(
129-
state: \.refreshable,
130-
action: RootAction.refreshable
125+
NavigationLink(
126+
"Refreshable",
127+
destination: RefreshableView(
128+
store: self.store.scope(
129+
state: \.refreshable,
130+
action: RootAction.refreshable
131+
)
131132
)
132133
)
133-
)
134134
#endif
135135

136136
NavigationLink(

Examples/CaseStudies/SwiftUICaseStudies/02-Effects-Refreshable.swift

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -73,50 +73,51 @@ let refreshableReducer = Reducer<
7373
}
7474

7575
#if compiler(>=5.5)
76-
struct RefreshableView: View {
77-
let store: Store<RefreshableState, RefreshableAction>
78-
79-
var body: some View {
80-
WithViewStore(self.store) { viewStore in
81-
List {
82-
Text(template: readMe, .body)
83-
84-
HStack {
85-
Button("-") { viewStore.send(.decrementButtonTapped) }
86-
Text("\(viewStore.count)")
87-
Button("+") { viewStore.send(.incrementButtonTapped) }
88-
}
89-
.buttonStyle(.plain)
76+
struct RefreshableView: View {
77+
let store: Store<RefreshableState, RefreshableAction>
78+
79+
var body: some View {
80+
WithViewStore(self.store) { viewStore in
81+
List {
82+
Text(template: readMe, .body)
83+
84+
HStack {
85+
Button("-") { viewStore.send(.decrementButtonTapped) }
86+
Text("\(viewStore.count)")
87+
Button("+") { viewStore.send(.incrementButtonTapped) }
88+
}
89+
.buttonStyle(.plain)
9090

91-
if let fact = viewStore.fact {
92-
Text(fact)
93-
.bold()
94-
}
95-
if viewStore.isLoading {
96-
Button("Cancel") {
97-
viewStore.send(.cancelButtonTapped, animation: .default)
91+
if let fact = viewStore.fact {
92+
Text(fact)
93+
.bold()
94+
}
95+
if viewStore.isLoading {
96+
Button("Cancel") {
97+
viewStore.send(.cancelButtonTapped, animation: .default)
98+
}
9899
}
99100
}
100-
}
101-
.refreshable {
102-
await viewStore.send(.refresh, while: \.isLoading)
101+
.refreshable {
102+
await
103+
viewStore.send(.refresh, while: \.isLoading)
104+
}
103105
}
104106
}
105107
}
106-
}
107108

108-
struct Refreshable_Previews: PreviewProvider {
109-
static var previews: some View {
110-
RefreshableView(
111-
store: .init(
112-
initialState: .init(),
113-
reducer: refreshableReducer,
114-
environment: .init(
115-
fact: .live,
116-
mainQueue: .main
109+
struct Refreshable_Previews: PreviewProvider {
110+
static var previews: some View {
111+
RefreshableView(
112+
store: .init(
113+
initialState: .init(),
114+
reducer: refreshableReducer,
115+
environment: .init(
116+
fact: .live,
117+
mainQueue: .main
118+
)
117119
)
118120
)
119-
)
121+
}
120122
}
121-
}
122123
#endif

0 commit comments

Comments
 (0)