diff --git a/Sources/ComposableArchitecture/Internal/CurrentValueRelay.swift b/Sources/ComposableArchitecture/Internal/CurrentValueRelay.swift index 6f8a9eb61c4d..bb09e396e08b 100644 --- a/Sources/ComposableArchitecture/Internal/CurrentValueRelay.swift +++ b/Sources/ComposableArchitecture/Internal/CurrentValueRelay.swift @@ -33,10 +33,11 @@ final class CurrentValueRelay: Publisher { } func send(_ value: Output) { - self.lock.sync { + let subscriptions = self.lock.sync { self.currentValue = value + return self.subscriptions } - for subscription in self.lock.sync({ self.subscriptions }) { + for subscription in subscriptions { subscription.receive(value) } }