Atomic
@propertyWrapper
final public class Atomic<Value>
因为要实现 mutate
的操作,需要使用class结构,struct结构不ok
-
Undocumented
Declaration
Swift
public init(wrappedValue: Value)
-
保证分别读写安全
Declaration
Swift
public var wrappedValue: Value { get set }
-
Undocumented
Declaration
Swift
public var projectedValue: Atomic<Value> { get }
-
保证边读编写安全
Declaration
Swift
public func mutate(_ mutation: (inout Value) -> Void)