In versions of RxSwift older than 3, subscribeNext(_: Value -> ())
was a specialized version of subscribe(_: Event<Value> -> ())
.
subscribe(_:)
will be triggered for all cases of the event, namely .next(Value)
, .error(Error)
and .completed
.
subscribeNext
will only run for .next(Value)
, first unpacking Value
.
As with RxSwift 3, subscribeNext
now
func subscribe( onNext: ((Value) -> ())? = nil, onError: ((Error) -> ())? = nil, onCompleted: (() -> ())? = nil, onDisposed: () -> () = nil )
The default values ββare nil, allowing users to call subscribe
only with callbacks that interest them.
source share