Skip to content

Commit 75107ba

Browse files
author
GGsrvg
committed
set value only from subject
1 parent aa1a90c commit 75107ba

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

Sources/ObservableField/Elements/Binding.swift

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,14 @@ open class Binding<TC, TV>: Cancellable where TC: UIControl, TV: Equatable {
5555
}
5656

5757
func configureBinding() {
58+
setValueFromSubject()
59+
5860
switch directionType {
5961
case .fromProperty:
60-
setValueFromProperty()
61-
6262
setBindingFromProperty()
6363
case .fromSubject:
64-
setValueFromSubject()
65-
6664
setBindingFromSubject()
6765
case .fromAll:
68-
setValueFromSubject()
69-
7066
setBindingFromProperty()
7167
setBindingFromSubject()
7268
}
@@ -98,13 +94,6 @@ open class Binding<TC, TV>: Cancellable where TC: UIControl, TV: Equatable {
9894

9995
}
10096

101-
private func setValueFromProperty() {
102-
let control = property.control
103-
if let value = property.getCallback?(control) {
104-
self.subject.send(value)
105-
}
106-
}
107-
10897
private func setValueFromSubject() {
10998
let control = property.control
11099
if let valueSubject = self.subject as? CurrentValueSubject<TV, Error> {

0 commit comments

Comments
 (0)