Skip to content

Commit 24f5f40

Browse files
stephencelisp4checo
authored andcommitted
Fix EffectTask deprecation
(cherry picked from commit 9e5221a88ebad8d44aeb95643a58264fc13417b5) # Conflicts: # Sources/ComposableArchitecture/Effect.swift
1 parent 2128fc5 commit 24f5f40

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

Sources/ComposableArchitecture/Effect.swift

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import ReactiveSwift
33
import XCTestDynamicOverlay
44

55
#if canImport(SwiftUI)
6-
import SwiftUI
6+
import SwiftUI
77
#endif
88

99
/// This type is deprecated in favor of ``EffectTask``. See its documentation for more information.
@@ -105,17 +105,17 @@ extension EffectProducer {
105105
/// the Combine interface to ``EffectProducer`` is considered soft deprecated, and you should
106106
/// eventually port to Swift's native concurrency tools.
107107
///
108-
/// > Important: The publisher interface to ``EffectTask`` is considered deperecated, and you should
109-
/// try converting any uses of that interface to Swift's native concurrency tools.
108+
/// > Important: The publisher interface to ``EffectTask`` is considered deprecated, and you should
109+
/// > try converting any uses of that interface to Swift's native concurrency tools.
110110
/// >
111111
/// > Also, ``Store`` is not thread safe, and so all effects must receive values on the same
112-
/// thread. This is typically the main thread, **and** if the store is being used to drive UI then
113-
/// it must receive values on the main thread.
112+
/// > thread. This is typically the main thread, **and** if the store is being used to drive UI
113+
/// > then it must receive values on the main thread.
114114
/// >
115115
/// > This is only an issue if using the Combine interface of ``EffectProducer`` as mentioned
116-
/// above. If you are using Swift's concurrency tools and the `.task`, `.run` and `.fireAndForget`
117-
/// functions on ``EffectTask``, then threading is automatically handled for you.
118-
public typealias EffectTask<Action> = Effect<Action, Never>
116+
/// > above. If you are using Swift's concurrency tools and the `.task`, `.run`, and
117+
/// > `.fireAndForget` functions on ``EffectTask``, then threading is automatically handled for you.
118+
public typealias EffectTask<Action> = EffectPublisher<Action, Never>
119119

120120
extension EffectProducer where Failure == Never {
121121
/// Wraps an asynchronous unit of work in an effect.
@@ -373,17 +373,17 @@ public struct Send<Action> {
373373
}
374374

375375
#if canImport(SwiftUI)
376-
/// Sends an action back into the system from an effect with animation.
377-
///
378-
/// - Parameters:
379-
/// - action: An action.
380-
/// - animation: An animation.
381-
public func callAsFunction(_ action: Action, animation: Animation?) {
382-
guard !Task.isCancelled else { return }
383-
withAnimation(animation) {
384-
self(action)
385-
}
376+
/// Sends an action back into the system from an effect with animation.
377+
///
378+
/// - Parameters:
379+
/// - action: An action.
380+
/// - animation: An animation.
381+
public func callAsFunction(_ action: Action, animation: Animation?) {
382+
guard !Task.isCancelled else { return }
383+
withAnimation(animation) {
384+
self(action)
386385
}
386+
}
387387
#endif
388388
}
389389

0 commit comments

Comments
 (0)