File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed
Sources/ComposableArchitecture Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -325,11 +325,11 @@ public final actor ActorIsolated<Value: Sendable> {
325
325
/// - Parameters: operation: An operation to be performed on the actor with the underlying value.
326
326
/// - Returns: The result of the operation.
327
327
public func withValue< T: Sendable > (
328
- _ operation: @Sendable ( inout Value ) async throws -> T
329
- ) async rethrows -> T {
328
+ _ operation: @Sendable ( inout Value ) throws -> T
329
+ ) rethrows -> T {
330
330
var value = self . value
331
331
defer { self . value = value }
332
- return try await operation ( & value)
332
+ return try operation ( & value)
333
333
}
334
334
335
335
/// Overwrite the isolated value with a new value.
Original file line number Diff line number Diff line change @@ -3,6 +3,23 @@ import Combine
3
3
import SwiftUI
4
4
import XCTestDynamicOverlay
5
5
6
+ // MARK: - Deprecated after 0.47.2
7
+
8
+ extension ActorIsolated {
9
+ @available (
10
+ * ,
11
+ deprecated,
12
+ message: " Use the non-async version of 'withValue'. "
13
+ )
14
+ public func withValue< T: Sendable > (
15
+ _ operation: @Sendable ( inout Value ) async throws -> T
16
+ ) async rethrows -> T {
17
+ var value = self . value
18
+ defer { self . value = value }
19
+ return try await operation ( & value)
20
+ }
21
+ }
22
+
6
23
// MARK: - Deprecated after 0.45.0:
7
24
8
25
@available (
You can’t perform that action at this time.
0 commit comments