Skip to content

Commit

Permalink
Run swift-format
Browse files Browse the repository at this point in the history
  • Loading branch information
stephencelis authored and actions-user committed Aug 11, 2021
1 parent e73b36e commit 67ccab6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Sources/ComposableArchitecture/Effect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ extension Publisher {
/// - transform: A mapping function that converts `Result<Output,Failure>` to another type.
/// - Returns: An effect that wraps `self`.
public func catchToEffect<T>(
_ transform: @escaping (Result<Output,Failure>) -> T
_ transform: @escaping (Result<Output, Failure>) -> T
) -> Effect<T, Never> {
self
.map { transform(.success($0)) }
Expand Down
3 changes: 2 additions & 1 deletion Sources/ComposableArchitecture/SwiftUI/WithViewStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ public struct WithViewStore<State, Action, Content> {
fileprivate var _body: Content {
#if DEBUG
if let prefix = self.prefix {
let difference = self.previousState(self.viewStore.state)
let difference =
self.previousState(self.viewStore.state)
.map {
debugDiff($0, self.viewStore.state).map { "(Changed state)\n\($0)" }
?? "(No difference in state detected)"
Expand Down
32 changes: 16 additions & 16 deletions Tests/ComposableArchitectureTests/WithViewStoreAppTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@ struct TestApp: App {
},
environment: ()
)

var body: some Scene {
WithViewStore(self.store) { viewStore in
#if os(iOS) || os(macOS)
WindowGroup {
EmptyView()
}
.commands {
CommandMenu("Commands") {
Button("Increment") {
viewStore.send(())
#if os(iOS) || os(macOS)
WindowGroup {
EmptyView()
}
.commands {
CommandMenu("Commands") {
Button("Increment") {
viewStore.send(())
}
.keyboardShortcut("+")
}
.keyboardShortcut("+")
}
}
#else
WindowGroup {
EmptyView()
}
#endif
#else
WindowGroup {
EmptyView()
}
#endif
}
}
}

0 comments on commit 67ccab6

Please sign in to comment.