@@ -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