@@ -11,14 +11,14 @@ infix operator <~ : BindingPrecedence
1111
1212/// Describes a target to which can be bound.
1313public protocol BindingTarget : class {
14- associatedtype ValueType
14+ associatedtype Value
1515
1616 /// The lifetime of `self`. The binding operators use this to determine when
1717 /// the binding should be teared down.
1818 var lifetime : Lifetime { get }
1919
2020 /// Consume a value from the binding.
21- func consume( _ value: ValueType )
21+ func consume( _ value: Value )
2222
2323 /// Binds a signal to a target, updating the target's value to the latest
2424 /// value sent by the signal.
@@ -50,7 +50,7 @@ public protocol BindingTarget: class {
5050 /// deinitialization of the target or the signal's `completed`
5151 /// event.
5252 @discardableResult
53- static func <~ < Source: SignalProtocol > ( target: Self , signal: Source ) -> Disposable ? where Source. Value == ValueType , Source. Error == NoError
53+ static func <~ < Source: SignalProtocol > ( target: Self , signal: Source ) -> Disposable ? where Source. Value == Value , Source. Error == NoError
5454}
5555
5656extension BindingTarget {
@@ -84,7 +84,7 @@ extension BindingTarget {
8484 /// deinitialization of the target or the signal's `completed`
8585 /// event.
8686 @discardableResult
87- public static func <~ < Source: SignalProtocol > ( target: Self , signal: Source ) -> Disposable ? where Source. Value == ValueType , Source. Error == NoError {
87+ public static func <~ < Source: SignalProtocol > ( target: Self , signal: Source ) -> Disposable ? where Source. Value == Value , Source. Error == NoError {
8888 return signal
8989 . take ( during: target. lifetime)
9090 . observeNext { [ weak target] value in
@@ -123,7 +123,7 @@ extension BindingTarget {
123123 /// deinitialization of the target or the producer's `completed
124124 /// event.
125125 @discardableResult
126- public static func <~ < Source: SignalProducerProtocol > ( target: Self , producer: Source ) -> Disposable where Source. Value == ValueType , Source. Error == NoError {
126+ public static func <~ < Source: SignalProducerProtocol > ( target: Self , producer: Source ) -> Disposable where Source. Value == Value , Source. Error == NoError {
127127 var disposable : Disposable !
128128
129129 producer
@@ -165,12 +165,12 @@ extension BindingTarget {
165165 /// - returns: A disposable that can be used to terminate binding before the
166166 /// deinitialization of the target or the source property.
167167 @discardableResult
168- public static func <~ < Source: PropertyProtocol > ( target: Self , property: Source ) -> Disposable where Source. Value == ValueType {
168+ public static func <~ < Source: PropertyProtocol > ( target: Self , property: Source ) -> Disposable where Source. Value == Value {
169169 return target <~ property. producer
170170 }
171171}
172172
173- extension BindingTarget where ValueType : OptionalProtocol {
173+ extension BindingTarget where Value : OptionalProtocol {
174174 /// Binds a signal to a target, updating the target's value to the latest
175175 /// value sent by the signal.
176176 ///
@@ -201,8 +201,8 @@ extension BindingTarget where ValueType: OptionalProtocol {
201201 /// deinitialization of the target or the signal's `completed`
202202 /// event.
203203 @discardableResult
204- public static func <~ < Source: SignalProtocol > ( target: Self , signal: Source ) -> Disposable ? where Source. Value == ValueType . Wrapped , Source. Error == NoError {
205- return target <~ signal. map ( ValueType . init ( reconstructing: ) )
204+ public static func <~ < Source: SignalProtocol > ( target: Self , signal: Source ) -> Disposable ? where Source. Value == Value . Wrapped , Source. Error == NoError {
205+ return target <~ signal. map ( Value . init ( reconstructing: ) )
206206 }
207207
208208 /// Binds a producer to a target, updating the target's value to the latest
@@ -236,8 +236,8 @@ extension BindingTarget where ValueType: OptionalProtocol {
236236 /// deinitialization of the target or the producer's `completed`
237237 /// event.
238238 @discardableResult
239- public static func <~ < Source: SignalProducerProtocol > ( target: Self , producer: Source ) -> Disposable where Source. Value == ValueType . Wrapped , Source. Error == NoError {
240- return target <~ producer. map ( ValueType . init ( reconstructing: ) )
239+ public static func <~ < Source: SignalProducerProtocol > ( target: Self , producer: Source ) -> Disposable where Source. Value == Value . Wrapped , Source. Error == NoError {
240+ return target <~ producer. map ( Value . init ( reconstructing: ) )
241241 }
242242
243243 /// Binds a property to a target, updating the target's value to the latest
@@ -272,7 +272,7 @@ extension BindingTarget where ValueType: OptionalProtocol {
272272 /// - returns: A disposable that can be used to terminate binding before the
273273 /// deinitialization of the target or the source property.
274274 @discardableResult
275- public static func <~ < Source: PropertyProtocol > ( target: Self , property: Source ) -> Disposable where Source. Value == ValueType . Wrapped {
275+ public static func <~ < Source: PropertyProtocol > ( target: Self , property: Source ) -> Disposable where Source. Value == Value . Wrapped {
276276 return target <~ property. producer
277277 }
278278}
@@ -311,3 +311,4 @@ public final class AnyBindingTarget<Value>: BindingTarget {
311311 sink ( value)
312312 }
313313}
314+
0 commit comments