Skip to content

Commit 7873627

Browse files
committed
Rename EffectSend as Send
1 parent bbf106b commit 7873627

File tree

6 files changed

+16
-25
lines changed

6 files changed

+16
-25
lines changed

Sources/ComposableArchitecture/Effect.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public struct EffectPublisher<Action, Failure: Error> {
5757
enum Operation {
5858
case none
5959
case publisher(AnyPublisher<Action, Failure>)
60-
case run(TaskPriority? = nil, @Sendable (EffectSend<Action>) async -> Void)
60+
case run(TaskPriority? = nil, @Sendable (Send<Action>) async -> Void)
6161
}
6262

6363
@usableFromInline
@@ -253,8 +253,8 @@ extension EffectPublisher where Failure == Never {
253253
/// - Returns: An effect wrapping the given asynchronous work.
254254
public static func run(
255255
priority: TaskPriority? = nil,
256-
operation: @escaping @Sendable (EffectSend<Action>) async throws -> Void,
257-
catch handler: (@Sendable (Error, EffectSend<Action>) async -> Void)? = nil,
256+
operation: @escaping @Sendable (Send<Action>) async throws -> Void,
257+
catch handler: (@Sendable (Error, Send<Action>) async -> Void)? = nil,
258258
file: StaticString = #file,
259259
fileID: StaticString = #fileID,
260260
line: UInt = #line
@@ -382,7 +382,7 @@ extension EffectPublisher where Failure == Never {
382382
///
383383
/// [callAsFunction]: https://docs.swift.org/swift-book/ReferenceManual/Declarations.html#ID622
384384
@MainActor
385-
public struct EffectSend<Action> {
385+
public struct Send<Action> {
386386
public let send: @MainActor (Action) -> Void
387387

388388
public init(send: @escaping @MainActor (Action) -> Void) {
@@ -561,7 +561,7 @@ extension EffectPublisher {
561561
operation: .run(priority) { send in
562562
await escaped.yield {
563563
await operation(
564-
EffectSend<Action> { action in
564+
Send<Action> { action in
565565
send(transform(action))
566566
}
567567
)

Sources/ComposableArchitecture/Effects/Animation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ extension EffectPublisher {
4646
return Self(
4747
operation: .run(priority) { send in
4848
await operation(
49-
EffectSend { value in
49+
Send { value in
5050
withTransaction(transaction) {
5151
send(value)
5252
}

Sources/ComposableArchitecture/Effects/Publisher.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extension EffectPublisher: Publisher {
2727
var isCompleted = false
2828
defer { isCompleted = true }
2929
#endif
30-
let send = EffectSend<Action> {
30+
let send = Send<Action> {
3131
#if DEBUG
3232
if isCompleted {
3333
runtimeWarn(

Sources/ComposableArchitecture/Internal/Deprecations.swift

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,16 @@ import XCTestDynamicOverlay
55

66
// MARK: - Deprecated after 0.51.0
77

8-
@available(
9-
*,
10-
deprecated,
11-
message: "Use 'EffectSend<Action>' instead."
12-
)
8+
// NB Soft deprecation to avoid deprecation messages when this type is inferred in `Effect`
9+
// without having to qualify it as `ComposableArchitecture.Send` there.
10+
@available(iOS, deprecated: 9999.0, message: "Use 'Send<Action>' instead.")
11+
@available(macOS, deprecated: 9999.0, message: "Use 'Send<Action>' instead.")
12+
@available(tvOS, deprecated: 9999.0, message: "Use 'Send<Action>' instead.")
13+
@available(watchOS, deprecated: 9999.0, message: "Use 'Send<Action>' instead.")
1314
extension EffectTask {
14-
public typealias Send = EffectSend<Action>
15+
public typealias Send = ComposableArchitecture.Send
1516
}
1617

17-
// MARK: - Deprecated after 0.50.4
18-
19-
@available(
20-
*,
21-
deprecated,
22-
message: "Use 'EffectSend<Action>' instead.",
23-
renamed: "EffectSend"
24-
)
25-
public typealias Send<Action> = EffectSend<Action>
26-
2718
// MARK: - Deprecated after 0.49.2
2819

2920
@available(

Sources/ComposableArchitecture/Reducer/AnyReducer/AnyReducerSignpost.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ extension EffectPublisher where Failure == Never {
131131
actionOutput
132132
)
133133
await operation(
134-
EffectSend { action in
134+
Send { action in
135135
os_signpost(
136136
.event, log: log, name: "Effect Output", "%sOutput from %s", prefix, actionOutput
137137
)

Sources/ComposableArchitecture/Store.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ public final class Store<State, Action> {
423423
defer { isCompleted = true }
424424
#endif
425425
await operation(
426-
EffectSend {
426+
Send {
427427
#if DEBUG
428428
if isCompleted {
429429
runtimeWarn(

0 commit comments

Comments
 (0)