Skip to content

Commit 44ae74e

Browse files
stephencelisgithub-actions[bot]
authored andcommitted
Run swift-format
1 parent af5ae21 commit 44ae74e

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

Examples/CaseStudies/UIKitCaseStudies/ListsOfState.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ final class CountersTableViewController: UITableViewController {
7070
CounterViewController(
7171
store: self.store.scope(
7272
state: \.counters[indexPathRow],
73-
action: \.counters[id: counter.id]
73+
action: \.counters[id:counter.id]
7474
)
7575
),
7676
animated: true

Sources/ComposableArchitecture/Store.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -939,8 +939,8 @@ func typeName(
939939
return name
940940
}
941941

942-
private extension Reducer {
943-
func scope<ChildState, ChildAction>(
942+
extension Reducer {
943+
fileprivate func scope<ChildState, ChildAction>(
944944
store: Store<State, Action>,
945945
state toChildState: @escaping (State) -> ChildState,
946946
id: ((State) -> AnyHashable)?,
@@ -1002,8 +1002,7 @@ private final class ScopedStoreReducer<RootState, RootAction, State, Action>: Re
10021002
state = self.toState(self.rootStore.stateSubject.value)
10031003
self.isSending = false
10041004
}
1005-
if
1006-
let action = self.fromAction(action),
1005+
if let action = self.fromAction(action),
10071006
let task = self.rootStore.send(action, originatingFrom: nil)
10081007
{
10091008
return .run { _ in await task.cancellableValue }

Tests/ComposableArchitectureTests/ScopeLoggerTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import XCTest
2-
import SwiftUI
31
@_spi(Logging) import ComposableArchitecture
2+
import SwiftUI
3+
import XCTest
44

55
class ScopeLoggerTests: XCTestCase {
66
func testScoping() {
@@ -17,7 +17,7 @@ class ScopeLoggerTests: XCTestCase {
1717
}
1818
let viewStore = ViewStore(store, observe: { $0 })
1919
let pathStore = store.scope(state: \.path, action: \.path)
20-
let elementStore = pathStore.scope(state: \.[id: 0]!, action: \.[id: 0])
20+
let elementStore = pathStore.scope(state: \.[id:0]!, action: \.[id:0])
2121
Logger.shared.clear()
2222
elementStore.send(.incrementButtonTapped)
2323
// TODO: This extra scope should go away once we get rid of store/reducer rescoping

0 commit comments

Comments
 (0)