Merge pull request #578 from tarunon/feature/drive_to_variable
Adding drive to Variable operator to Driver
This commit is contained in:
commit
7dffae6dc8
|
|
@ -26,6 +26,19 @@ extension DriverConvertibleType {
|
|||
return self.asObservable().subscribe(observer)
|
||||
}
|
||||
|
||||
/**
|
||||
Creates new subscription and sends elements to variable.
|
||||
|
||||
- parameter variable: Target variable for sequence elements.
|
||||
- returns: Disposable object that can be used to unsubscribe the observer from the variable.
|
||||
*/
|
||||
@warn_unused_result(message="http://git.io/rxs.ud")
|
||||
public func drive(variable: Variable<E>) -> Disposable {
|
||||
return drive(onNext: { e in
|
||||
variable.value = e
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
Subscribes to observable sequence using custom binder function.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue