Skip to content

Commit 0f01ec1

Browse files
committed
Wrap SwiftUI specific code in #if canImport(SwiftUI)
1 parent 2609c22 commit 0f01ec1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/ComposableArchitecture/Beta/Concurrency.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import ReactiveSwift
2+
#if canImport(SwiftUI)
23
import SwiftUI
4+
#endif
35

46
#if compiler(>=5.5)
57
@available(iOS 15, macOS 12, tvOS 15, watchOS 8, *)
@@ -195,6 +197,7 @@ import SwiftUI
195197
await self.suspend(while: predicate)
196198
}
197199

200+
#if canImport(SwiftUI)
198201
/// Sends an action into the store and then suspends while a piece of state is `true`.
199202
///
200203
/// See the documentation of ``send(_:while:)`` for more information.
@@ -212,6 +215,7 @@ import SwiftUI
212215
withAnimation(animation) { self.send(action) }
213216
await self.suspend(while: predicate)
214217
}
218+
#endif
215219

216220
/// Suspends while a predicate on state is `true`.
217221
///

0 commit comments

Comments
 (0)