Skip to content

Commit 5ab0ab1

Browse files
stephencelisp4checo
authored andcommitted
Run swift-format
(cherry picked from commit c55c626b6b9658644d4d1a4fae011194fbf59cd3)
1 parent 9a06e90 commit 5ab0ab1

26 files changed

+5029
-5028
lines changed

Sources/ComposableArchitecture/Effect.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -332,17 +332,17 @@ public struct Send<Action> {
332332
}
333333

334334
#if canImport(SwiftUI)
335-
/// Sends an action back into the system from an effect with animation.
336-
///
337-
/// - Parameters:
338-
/// - action: An action.
339-
/// - animation: An animation.
340-
public func callAsFunction(_ action: Action, animation: Animation?) {
341-
guard !Task.isCancelled else { return }
342-
withAnimation(animation) {
343-
self(action)
335+
/// Sends an action back into the system from an effect with animation.
336+
///
337+
/// - Parameters:
338+
/// - action: An action.
339+
/// - animation: An animation.
340+
public func callAsFunction(_ action: Action, animation: Animation?) {
341+
guard !Task.isCancelled else { return }
342+
withAnimation(animation) {
343+
self(action)
344+
}
344345
}
345-
}
346346
#endif
347347
}
348348

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
#if canImport(SwiftUI)
22
import ReactiveSwift
3-
import SwiftUI
3+
import SwiftUI
44

5-
extension EffectProducer {
6-
/// Wraps the emission of each element with SwiftUI's `withAnimation`.
7-
///
8-
/// ```swift
9-
/// case .buttonTapped:
10-
/// return .task {
11-
/// .activityResponse(await self.apiClient.fetchActivity())
12-
/// }
13-
/// .animation()
14-
/// ```
15-
///
16-
/// - Parameter animation: An animation.
5+
extension EffectProducer {
6+
/// Wraps the emission of each element with SwiftUI's `withAnimation`.
7+
///
8+
/// ```swift
9+
/// case .buttonTapped:
10+
/// return .task {
11+
/// .activityResponse(await self.apiClient.fetchActivity())
12+
/// }
13+
/// .animation()
14+
/// ```
15+
///
16+
/// - Parameter animation: An animation.
1717
/// - Returns: An effect.
18-
public func animation(_ animation: Animation? = .default) -> Self {
19-
switch self.operation {
20-
case .none:
21-
return .none
18+
public func animation(_ animation: Animation? = .default) -> Self {
19+
switch self.operation {
20+
case .none:
21+
return .none
2222
case let .producer(producer):
23-
return Self(
23+
return Self(
2424
operation: .producer(
2525
SignalProducer<Action, Failure> { observer, _ in
2626
producer.start { action in
@@ -38,21 +38,21 @@ extension EffectProducer {
3838
}
3939
}
4040
}
41+
)
4142
)
42-
)
43-
case let .run(priority, operation):
44-
return Self(
45-
operation: .run(priority) { send in
46-
await operation(
47-
Send { value in
48-
withAnimation(animation) {
49-
send(value)
43+
case let .run(priority, operation):
44+
return Self(
45+
operation: .run(priority) { send in
46+
await operation(
47+
Send { value in
48+
withAnimation(animation) {
49+
send(value)
50+
}
5051
}
51-
}
52-
)
53-
}
54-
)
52+
)
53+
}
54+
)
55+
}
5556
}
5657
}
57-
}
5858
#endif

0 commit comments

Comments
 (0)