File tree Expand file tree Collapse file tree 1 file changed +15
-11
lines changed
Sources/ComposableArchitecture Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Original file line number Diff line number Diff line change 11import Foundation
22import ReactiveSwift
3- import SwiftUI
3+ #if canImport(SwiftUI)
4+ import SwiftUI
5+ #endif
46import XCTestDynamicOverlay
57
68/// The ``Effect`` type encapsulates a unit of work that can be run in the outside world, and can
@@ -316,17 +318,19 @@ public struct Send<Action> {
316318 self . send ( action)
317319 }
318320
319- /// Sends an action back into the system from an effect with animation.
320- ///
321- /// - Parameters:
322- /// - action: An action.
323- /// - animation: An animation.
324- public func callAsFunction( _ action: Action , animation: Animation ? ) {
325- guard !Task. isCancelled else { return }
326- withAnimation ( animation) {
327- self ( action)
321+ #if canImport(SwiftUI)
322+ /// Sends an action back into the system from an effect with animation.
323+ ///
324+ /// - Parameters:
325+ /// - action: An action.
326+ /// - animation: An animation.
327+ public func callAsFunction( _ action: Action , animation: Animation ? ) {
328+ guard !Task. isCancelled else { return }
329+ withAnimation ( animation) {
330+ self ( action)
331+ }
328332 }
329- }
333+ #endif
330334}
331335
332336// MARK: - Composing Effects
You can’t perform that action at this time.
0 commit comments