@@ -3,7 +3,7 @@ import ReactiveSwift
3
3
import XCTestDynamicOverlay
4
4
5
5
#if canImport(SwiftUI)
6
- import SwiftUI
6
+ import SwiftUI
7
7
#endif
8
8
9
9
/// This type is deprecated in favor of ``EffectTask``. See its documentation for more information.
@@ -115,7 +115,7 @@ extension EffectProducer {
115
115
/// > This is only an issue if using the Combine interface of ``EffectProducer`` as mentioned
116
116
/// > above. If you are using Swift's concurrency tools and the `.task`, `.run`, and
117
117
/// > `.fireAndForget` functions on ``EffectTask``, then threading is automatically handled for you.
118
- public typealias EffectTask < Action> = EffectPublisher < Action , Never >
118
+ public typealias EffectTask < Action> = EffectProducer < Action , Never >
119
119
120
120
extension EffectProducer where Failure == Never {
121
121
/// Wraps an asynchronous unit of work in an effect.
@@ -340,20 +340,22 @@ extension EffectProducer where Failure == Never {
340
340
Self ( value: action)
341
341
}
342
342
343
- /// Initializes an effect that immediately emits the action passed in.
344
- ///
345
- /// > Note: We do not recommend using `Effect.send` to share logic. Instead, limit usage to
346
- /// > child-parent communication, where a child may want to emit a "delegate" action for a parent
347
- /// > to listen to.
348
- /// >
349
- /// > For more information, see <doc:Performance#Sharing-logic-with-actions>.
350
- ///
351
- /// - Parameters:
352
- /// - action: The action that is immediately emitted by the effect.
353
- /// - animation: An animation.
354
- public static func send( _ action: Action , animation: Animation ? = nil ) -> Self {
355
- Self ( value: action) . animation ( animation)
356
- }
343
+ #if canImport(SwiftUI)
344
+ /// Initializes an effect that immediately emits the action passed in.
345
+ ///
346
+ /// > Note: We do not recommend using `Effect.send` to share logic. Instead, limit usage to
347
+ /// > child-parent communication, where a child may want to emit a "delegate" action for a parent
348
+ /// > to listen to.
349
+ /// >
350
+ /// > For more information, see <doc:Performance#Sharing-logic-with-actions>.
351
+ ///
352
+ /// - Parameters:
353
+ /// - action: The action that is immediately emitted by the effect.
354
+ /// - animation: An animation.
355
+ public static func send( _ action: Action , animation: Animation ? = nil ) -> Self {
356
+ Self ( value: action) . animation ( animation)
357
+ }
358
+ #endif
357
359
}
358
360
359
361
/// A type that can send actions back into the system when used from
@@ -401,15 +403,15 @@ public struct Send<Action> {
401
403
}
402
404
403
405
#if canImport(SwiftUI)
404
- /// Sends an action back into the system from an effect with animation.
405
- ///
406
- /// - Parameters:
407
- /// - action: An action.
408
- /// - animation: An animation.
409
- public func callAsFunction( _ action: Action , animation: Animation ? ) {
410
- callAsFunction ( action, transaction: Transaction ( animation: animation) )
411
- }
412
-
406
+ /// Sends an action back into the system from an effect with animation.
407
+ ///
408
+ /// - Parameters:
409
+ /// - action: An action.
410
+ /// - animation: An animation.
411
+ public func callAsFunction( _ action: Action , animation: Animation ? ) {
412
+ callAsFunction ( action, transaction: Transaction ( animation: animation) )
413
+ }
414
+
413
415
/// Sends an action back into the system from an effect with transaction.
414
416
///
415
417
/// - Parameters:
0 commit comments