We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
withLock
1 parent fea248b commit 7461262Copy full SHA for 7461262
Sources/ComposableArchitecture/SharedState/Shared.swift
@@ -67,8 +67,8 @@ public struct Shared<Value> {
67
}
68
69
/// Perform an operation on shared state with isolated access to the underlying value.
70
- public func withLock(_ transform: @Sendable (inout Value) -> Void) {
71
- transform(&self._wrappedValue)
+ public func withLock<R>(_ transform: @Sendable (inout Value) throws -> R) rethrows -> R {
+ try transform(&self._wrappedValue)
72
73
74
/// The underlying value referenced by the shared variable.
0 commit comments