Undo equatable bindings due to complexity
This commit is contained in:
parent
99603193b9
commit
a8ce63a67f
@ -65,8 +65,6 @@ public struct Binding<Value> {
|
|||||||
|
|
||||||
/// The closure for getting the value.
|
/// The closure for getting the value.
|
||||||
private let getValue: () -> Value
|
private let getValue: () -> Value
|
||||||
/// The cached value for comparison purposes.
|
|
||||||
private let value: Value
|
|
||||||
/// The closure for settings the value.
|
/// The closure for settings the value.
|
||||||
private let setValue: (Value) -> Void
|
private let setValue: (Value) -> Void
|
||||||
/// Handlers observing whether the binding changes.
|
/// Handlers observing whether the binding changes.
|
||||||
@ -89,7 +87,6 @@ public struct Binding<Value> {
|
|||||||
/// - set: The closure for setting the value.
|
/// - set: The closure for setting the value.
|
||||||
public init(get: @escaping () -> Value, set: @escaping (Value) -> Void) {
|
public init(get: @escaping () -> Value, set: @escaping (Value) -> Void) {
|
||||||
self.getValue = get
|
self.getValue = get
|
||||||
self.value = get()
|
|
||||||
self.setValue = set
|
self.setValue = set
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,18 +112,6 @@ public struct Binding<Value> {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extension Binding: Equatable where Value: Equatable {
|
|
||||||
|
|
||||||
/// Whether two binding values were equal when they were initialized.
|
|
||||||
/// - Parameters:
|
|
||||||
/// - lhs: The first binding.
|
|
||||||
/// - rhs: The second binding.
|
|
||||||
public static func == (lhs: Self, rhs: Self) -> Bool {
|
|
||||||
lhs.value == rhs.value
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Extend bindings.
|
/// Extend bindings.
|
||||||
extension Binding where Value: MutableCollection {
|
extension Binding where Value: MutableCollection {
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user