Skip to content

Commit

Permalink
fix: allow access to Reference definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
sbertix committed May 22, 2021
1 parent 52fbbd8 commit d740425
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Sources/ComposableRequest/Extensions/Reference.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,28 @@ public final class Atomic<Value> {
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<T>(_ transform: (inout Value) -> T) -> T {
public func sync<T>(_ 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)
}
}
Expand All @@ -46,12 +46,12 @@ public final class Atomic<Value> {
/// for some value.
public final class Reference<Value> {
/// 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
}
}

0 comments on commit d740425

Please sign in to comment.