Skip to content

Commit b1e2dce

Browse files
stephencelisactions-user
authored andcommitted
Run swift-format
1 parent 9fbd834 commit b1e2dce

File tree

1 file changed

+66
-66
lines changed

1 file changed

+66
-66
lines changed

Sources/ComposableArchitecture/SwiftUI/WithViewStore.swift

Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -106,76 +106,76 @@ extension WithViewStore: DynamicViewContent where State: Collection, Content: Dy
106106

107107
#if compiler(>=5.3)
108108

109-
import SwiftUI
110-
111-
/// A structure that transforms a store into an observable view store in order to compute scenes from
112-
/// store state.
113-
@available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *)
114-
extension WithViewStore: Scene where Content: Scene {
115-
public typealias Body = Content
116-
117-
/// Initializes a structure that transforms a store into an observable view store in order to
118-
/// compute scenes from store state.
119-
120-
/// - Parameters:
121-
/// - store: A store.
122-
/// - isDuplicate: A function to determine when two `State` values are equal. When values are
123-
/// equal, repeat view computations are removed,
124-
/// - content: A function that can generate content from a view store.
125-
public init(
126-
_ store: Store<State, Action>,
127-
removeDuplicates isDuplicate: @escaping (State, State) -> Bool,
128-
@SceneBuilder content: @escaping (ViewStore<State, Action>) -> Content
129-
) {
130-
self.content = content
131-
self.viewStore = ViewStore(store, removeDuplicates: isDuplicate)
132-
}
133-
134-
public var body: Content {
135-
#if DEBUG
136-
if let prefix = self.prefix {
137-
print(
138-
"""
139-
\(prefix.isEmpty ? "" : "\(prefix): ")\
140-
Evaluating WithViewStore<\(State.self), \(Action.self), ...>.body
141-
"""
142-
)
143-
}
144-
#endif
145-
return self.content(self.viewStore)
109+
import SwiftUI
110+
111+
/// A structure that transforms a store into an observable view store in order to compute scenes from
112+
/// store state.
113+
@available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *)
114+
extension WithViewStore: Scene where Content: Scene {
115+
public typealias Body = Content
116+
117+
/// Initializes a structure that transforms a store into an observable view store in order to
118+
/// compute scenes from store state.
119+
120+
/// - Parameters:
121+
/// - store: A store.
122+
/// - isDuplicate: A function to determine when two `State` values are equal. When values are
123+
/// equal, repeat view computations are removed,
124+
/// - content: A function that can generate content from a view store.
125+
public init(
126+
_ store: Store<State, Action>,
127+
removeDuplicates isDuplicate: @escaping (State, State) -> Bool,
128+
@SceneBuilder content: @escaping (ViewStore<State, Action>) -> Content
129+
) {
130+
self.content = content
131+
self.viewStore = ViewStore(store, removeDuplicates: isDuplicate)
132+
}
133+
134+
public var body: Content {
135+
#if DEBUG
136+
if let prefix = self.prefix {
137+
print(
138+
"""
139+
\(prefix.isEmpty ? "" : "\(prefix): ")\
140+
Evaluating WithViewStore<\(State.self), \(Action.self), ...>.body
141+
"""
142+
)
143+
}
144+
#endif
145+
return self.content(self.viewStore)
146+
}
146147
}
147-
}
148148

149-
@available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *)
150-
extension WithViewStore where Content: Scene, State: Equatable {
151-
/// Initializes a structure that transforms a store into an observable view store in order to
152-
/// compute views from equatable store state.
153-
///
154-
/// - Parameters:
155-
/// - store: A store of equatable state.
156-
/// - content: A function that can generate content from a view store.
157-
public init(
158-
_ store: Store<State, Action>,
159-
@SceneBuilder content: @escaping (ViewStore<State, Action>) -> Content
160-
) {
161-
self.init(store, removeDuplicates: ==, content: content)
149+
@available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *)
150+
extension WithViewStore where Content: Scene, State: Equatable {
151+
/// Initializes a structure that transforms a store into an observable view store in order to
152+
/// compute views from equatable store state.
153+
///
154+
/// - Parameters:
155+
/// - store: A store of equatable state.
156+
/// - content: A function that can generate content from a view store.
157+
public init(
158+
_ store: Store<State, Action>,
159+
@SceneBuilder content: @escaping (ViewStore<State, Action>) -> Content
160+
) {
161+
self.init(store, removeDuplicates: ==, content: content)
162+
}
162163
}
163-
}
164164

165-
@available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *)
166-
extension WithViewStore where Content: Scene, State == Void {
167-
/// Initializes a structure that transforms a store into an observable view store in order to
168-
/// compute views from equatable store state.
169-
///
170-
/// - Parameters:
171-
/// - store: A store of equatable state.
172-
/// - content: A function that can generate content from a view store.
173-
public init(
174-
_ store: Store<State, Action>,
175-
@SceneBuilder content: @escaping (ViewStore<State, Action>) -> Content
176-
) {
177-
self.init(store, removeDuplicates: ==, content: content)
165+
@available(iOS 14.0, macOS 11.0, tvOS 14.0, watchOS 7.0, *)
166+
extension WithViewStore where Content: Scene, State == Void {
167+
/// Initializes a structure that transforms a store into an observable view store in order to
168+
/// compute views from equatable store state.
169+
///
170+
/// - Parameters:
171+
/// - store: A store of equatable state.
172+
/// - content: A function that can generate content from a view store.
173+
public init(
174+
_ store: Store<State, Action>,
175+
@SceneBuilder content: @escaping (ViewStore<State, Action>) -> Content
176+
) {
177+
self.init(store, removeDuplicates: ==, content: content)
178+
}
178179
}
179-
}
180180

181181
#endif

0 commit comments

Comments
 (0)