rx-java – RxSwift – . subscribe vs . What’s the difference between subscribenext?
•
Java
What is the difference between these two operators? http://reactivex.io Don't mention it subscribeNext.
Solution
In rxswift versions earlier than 3, subscribenext (: value – > ()) is a dedicated version of subscribe (: event < value > – > ())
Subscription (:) will be triggered for each event condition, i.e next(Value),. Error (error) and completed.
Subscribenext triggers only Next (value), unzip value first
Starting with rxswift version 3, it is now subscribenext
func subscribe( onNext: ((Value) -> ())? = nil,onError: ((Error) -> ())? = nil,onCompleted: (() -> ())? = nil,onDisposed: () -> () = nil )
The nil default allows users to call subscribe only with callbacks that are of interest to them
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码