Readds `onError` to `Driver` `do` operator because removing it would break API backwards compatibility for 2.0.0.

This commit is contained in:
Krunoslav Zaher 2016-01-25 21:54:31 +01:00
parent 300931015b
commit b8d46bec0c
1 changed files with 3 additions and 3 deletions

View File

@ -124,15 +124,15 @@ extension DriverConvertibleType {
Invokes an action for each event in the observable sequence, and propagates all observer messages through the result sequence.
- parameter onNext: Action to invoke for each element in the observable sequence.
- parameter onError: Action to invoke upon errored termination of the observable sequence.
- parameter onError: Action to invoke upon errored termination of the observable sequence. This callback will never be invoked since driver can't error out.
- parameter onCompleted: Action to invoke upon graceful termination of the observable sequence.
- returns: The source sequence with the side-effecting behavior applied.
*/
@warn_unused_result(message="http://git.io/rxs.uo")
public func doOn(onNext onNext: (E -> Void)? = nil, onCompleted: (() -> Void)? = nil)
public func doOn(onNext onNext: (E -> Void)? = nil, onError: (ErrorType -> Void)? = nil, onCompleted: (() -> Void)? = nil)
-> Driver<E> {
let source = self.asObservable()
.doOn(onNext: onNext, onCompleted: onCompleted)
.doOn(onNext: onNext, onError: onError, onCompleted: onCompleted)
return Driver(source)
}