From d74042557e9960441ecc7e03b173117b9bcf5126 Mon Sep 17 00:00:00 2001 From: sbertix Date: Sat, 22 May 2021 11:52:12 +0200 Subject: [PATCH] fix: allow access to `Reference` definitions --- Sources/ComposableRequest/Extensions/Reference.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Sources/ComposableRequest/Extensions/Reference.swift b/Sources/ComposableRequest/Extensions/Reference.swift index a0a57642..b3fbd14b 100644 --- a/Sources/ComposableRequest/Extensions/Reference.swift +++ b/Sources/ComposableRequest/Extensions/Reference.swift @@ -16,28 +16,28 @@ public final class Atomic { private var _value: Value /// The underlying value. - var value: Value { + public var value: Value { queue.sync { self._value } } /// Init. /// /// - parameter value: A valid `Value`. - init(_ value: Value) { + public init(_ value: Value) { self._value = value } /// Sync the underlying value. /// /// - parameter transform: A valid transformation. - func sync(_ transform: (inout Value) -> T) -> T { + public func sync(_ transform: (inout Value) -> T) -> T { queue.sync { transform(&self._value) } } /// Mutate the undelrying value. /// /// - parameter transform: A valid transformation. - func mutate(_ transform: (inout Value) -> Void) { + public func mutate(_ transform: (inout Value) -> Void) { sync(transform) } } @@ -46,12 +46,12 @@ public final class Atomic { /// for some value. public final class Reference { /// The underlying value. - var value: Value + public var value: Value /// Init. /// /// - parameter value: A valid `Value`. - init(_ value: Value) { + public init(_ value: Value) { self.value = value } }